From a0375245b4471277ba2952b195c2cdd13e813b40 Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Sun, 29 Sep 2024 12:57:17 +0200 Subject: [PATCH] Shellies for FFW floor and bath added --- devdi | 2 +- function/__init__.py | 5 +++++ function/first_floor_west.py | 34 ++++++++++++++++++++++++++++++++-- 3 files changed, 38 insertions(+), 3 deletions(-) diff --git a/devdi b/devdi index 66a4719..8f8ace1 160000 --- a/devdi +++ b/devdi @@ -1 +1 @@ -Subproject commit 66a471979d41bb6477b676dddd3f5959ba0326cc +Subproject commit 8f8ace13c131abf9c4dfb79087fa1c13c76805d2 diff --git a/function/__init__.py b/function/__init__.py index 343e636..76a94bf 100644 --- a/function/__init__.py +++ b/function/__init__.py @@ -71,6 +71,11 @@ class all_functions(room_collection): # FFE 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.all_off) + # FFW ALL OFF - Long push ffw_floor + self.ffw.floor.main_light_shelly.add_callback(self.ffw.floor.main_light_shelly.KEY_LONGPUSH_0, + True, self.ffw.floor.main_light_shelly.flash_0_mcb) + self.ffw.floor.main_light_shelly.add_callback(self.ffw.floor.main_light_shelly.KEY_LONGPUSH_0, True, self.ffw.all_off) + def init_sumer_winter_mode(self): # ALL summer/winter mode self.videv_summer_mode = videv_pure_switch(self.mqtt_client, config.TOPIC_ALL_SUMMER_WINTER_MODE) diff --git a/function/first_floor_west.py b/function/first_floor_west.py index 3d7eefa..448a1eb 100644 --- a/function/first_floor_west.py +++ b/function/first_floor_west.py @@ -7,7 +7,7 @@ from devdi import topic as props from function.db import get_radiator_data, set_radiator_data from function.modules import heating_function from function.rooms import room, room_collection -from function.videv import videv_switch_brightness, videv_switch_brightness_color_temp, videv_heating +from function.videv import videv_switch_brightness, videv_switch_brightness_color_temp, videv_heating, videv_switching import logging @@ -23,12 +23,34 @@ loc = props.LOC_FFW class first_floor_west(room_collection): def __init__(self, mqtt_client, pd, vd): super().__init__(mqtt_client, pd, vd) + self.floor = first_floor_west_floor(mqtt_client, pd, vd) self.bath = first_floor_west_bath(mqtt_client, pd, vd) self.julian = first_floor_west_julian(mqtt_client, pd, vd) self.livingroom = first_floor_west_living(mqtt_client, pd, vd) self.sleep = first_floor_west_sleep(mqtt_client, pd, vd) +class first_floor_west_floor(room): + def __init__(self, mqtt_client, pd, vd): + roo = props.ROO_FLO + # + # Device initialisation + # + # http://shelly1-58BF25D848EA + # main light + self.main_light_shelly = pd.get(props.STG_SHE, loc, roo, props.FUN_MAL) + super().__init__(mqtt_client, pd, vd) + + # + # Virtual Device Interface + # + # main light + self.main_light = videv_switching( + mqtt_client, config.TOPIC_FFE_FLOOR_MAIN_LIGHT_VIDEV, + self.main_light_shelly, self.main_light_shelly.KEY_OUTPUT_0 + ) + + class first_floor_west_julian(room): def __init__(self, mqtt_client, pd, vd): roo = props.ROO_JUL @@ -76,6 +98,9 @@ class first_floor_west_bath(room): # # Device initialisation # + # http://shelly1-58BF25D84219 + # main light + self.main_light_shelly = pd.get(props.STG_SHE, loc, roo, props.FUN_MAL) # heating function self.heating_valve = pd.get(props.STG_ZFW, loc, roo, props.FUN_HEA) super().__init__(mqtt_client, pd, vd) @@ -94,6 +119,11 @@ class first_floor_west_bath(room): # # Virtual Device Interface # + # main light + self.main_light = videv_switching( + mqtt_client, config.TOPIC_FFE_FLOOR_MAIN_LIGHT_VIDEV, + self.main_light_shelly, self.main_light_shelly.KEY_OUTPUT_0 + ) # heating function self.heating_function_videv = videv_heating( mqtt_client, config.TOPIC_FFW_BATH_HEATING_VALVE_VIDEV, @@ -157,7 +187,7 @@ class first_floor_west_sleep(room): self.heating_valve = pd.get(props.STG_ZFW, loc, roo, props.FUN_HEA) super().__init__(mqtt_client, pd, vd) - # + # # Functionality initialisation # # heating function