From 46a2c598aeadf5219bdfdc43fb7abccec5b3f78b Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Fri, 6 Jan 2023 21:39:02 +0100 Subject: [PATCH] staiway longpress all off, all off bug-fix, circulation pump topic from config, gfw floor light topic update --- function/__init__.py | 11 +++++++++-- function/common.py | 5 +++-- function/ground_floor_west.py | 4 ++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/function/__init__.py b/function/__init__.py index 081019a..32427ad 100644 --- a/function/__init__.py +++ b/function/__init__.py @@ -16,8 +16,12 @@ except ImportError: ROOT_LOGGER_NAME = 'root' logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__) +# TODO: implement TOPIC-changes in config.py (gfw.floor.main_light) +# TODO: implement gui element for tradfri light as one class +# TODO: implement devices.nodered_gui_heatvalve incl. setpoint, boost, ... + replace led with timer +# TODO: improve heating function +# TODO: implement timer and motion leds for stairwasy # TODO: implement devices.nodered_gui_timer (for circulation pump) -# implement devices.nodered_gui_heatvalve incl. setpoint, boost, ... and functions from funtion.module # improve devices.brennenstuhl_heatvalve # improve the implementation in common if highly reduced, just move it to function.__init__.py # TODO: implement garland (incl. day events like sunset, sunrise, ...) @@ -71,6 +75,9 @@ class all_functions(object): # Long push ffe_floor self.ffe_floor.main_light_shelly.add_callback(devices.shelly.KEY_LONGPUSH_0, True, self.ffe_floor.all_off_feedback) self.ffe_floor.main_light_shelly.add_callback(devices.shelly.KEY_LONGPUSH_0, True, self.ffe_off) + # Long push stairway + self.stw_stairway.main_light_shelly.add_callback(devices.shelly.KEY_LONGPUSH_0, True, self.stw_stairway.all_off_feedback) + self.stw_stairway.main_light_shelly.add_callback(devices.shelly.KEY_LONGPUSH_0, True, self.all_off) # Long push input device self.ffe_sleep.button_tradfri.add_callback(devices.tradfri_button.KEY_ACTION, devices.tradfri_button.ACTION_RIGHT_LONG, self.ffe_off) @@ -121,7 +128,7 @@ class all_functions(object): def gfw_dirk_input_1(self, device, key, data): if self.last_gfw_dirk_input_1 is not None: if self.last_gfw_dirk_input_1 != data: - self.gfw_floor.main_light_shelly.toggle_main_light(device, key, data) + self.gfw_floor.main_light_shelly.toggle_output_0_mcb(device, key, data) self.last_gfw_dirk_input_1 = data def devicelist(self): diff --git a/function/common.py b/function/common.py index a37acfe..268a381 100644 --- a/function/common.py +++ b/function/common.py @@ -2,6 +2,7 @@ # -*- coding: utf-8 -*- # +import config import devices from function.rooms import room_shelly from function.modules import heating_function_brennenstuhl @@ -18,11 +19,11 @@ logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__) class common_circulation_pump(room_shelly): def __init__(self, mqtt_client): # http://shelly1-E89F6D85A466 - super().__init__(mqtt_client, "shellies/ffe/kitchen/circulation_pump", "gui/none/common/circulation_pump/switch") + super().__init__(mqtt_client, config.TOPIC_FFE_KITCHEN_CIRCULATION_PUMP_SHELLY, config.TOPIC_FFE_KITCHEN_CIRCULATION_PUMP_GUI_SWITCH) # self.main_light_shelly.add_callback(devices.shelly.KEY_OUTPUT_0, None, self.circ_pump_actions, True) # - self.gui_timer_view = devices.nodered_gui_heatvalve(mqtt_client, "gui/ffe_circ_pump_timer") + self.gui_timer_view = devices.nodered_gui_heatvalve(mqtt_client, config.TOPIC_FFE_KITCHEN_CIRCULATION_PUMP_GUI_TIMER) self.gui_timer_view.set_feedback('-') # self.ct = task.periodic(6, self.cyclic_task) diff --git a/function/ground_floor_west.py b/function/ground_floor_west.py index 754f83c..e1ca445 100644 --- a/function/ground_floor_west.py +++ b/function/ground_floor_west.py @@ -20,11 +20,11 @@ class ground_floor_west_floor(room_shelly_silvercrest_light): # http://shelly1l-84CCA8AD1148 def __init__(self, mqtt_client): super().__init__(mqtt_client, config.TOPIC_GFW_FLOOR_MAIN_LIGHT_SHELLY, config.TOPIC_GFW_FLOOR_MAIN_LIGHT_GUI_SWITCH, - config.TOPIC_GFW_FLOOR_MAIN_LIGHT_A_ZIGBEE, config.TOPIC_GFW_FLOOR_MAIN_LIGHT_GUI_BR_CT) + config.TOPIC_GFW_FLOOR_MAIN_LIGHT_1_ZIGBEE, config.TOPIC_GFW_FLOOR_MAIN_LIGHT_GUI_BR_CT) # # Callback initialisation # - self.main_light_tradfri_2 = devices.tradfri_light(mqtt_client, config.TOPIC_GFW_FLOOR_MAIN_LIGHT_B_ZIGBEE) + self.main_light_tradfri_2 = devices.tradfri_light(mqtt_client, config.TOPIC_GFW_FLOOR_MAIN_LIGHT_2_ZIGBEE) self.main_light_tradfri.add_callback(devices.tradfri_light.KEY_BRIGHTNESS, None, self.main_light_tradfri_2.set_brightness_mcb) self.main_light_tradfri.add_callback(devices.tradfri_light.KEY_COLOR_TEMP, None, self.main_light_tradfri_2.set_color_temp_mcb)