From 248e9432d1ad1fd52796da3bacb98d457ee132ab Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Sun, 1 Sep 2024 12:49:42 +0200 Subject: [PATCH] Added wifi garden and wardrobe light sleep ffe --- .vscode/launch.json | 2 +- devdi | 2 +- devices/__init__.py | 1 + function/first_floor_east.py | 7 +++++++ function/garden.py | 9 +++++++++ topics.py | 6 ++++-- 6 files changed, 23 insertions(+), 4 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 09d8a83..e9ce2f2 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -6,7 +6,7 @@ "configurations": [ { "name": "Python: Main File execution", - "type": "python", + "type": "debugpy", "request": "launch", "program": "${workspaceFolder}/smart_brain.py", "console": "integratedTerminal", diff --git a/devdi b/devdi index 1b8ad26..66a4719 160000 --- a/devdi +++ b/devdi @@ -1 +1 @@ -Subproject commit 1b8ad26f21c138580764a0f6355afeb2663d2a1f +Subproject commit 66a471979d41bb6477b676dddd3f5959ba0326cc diff --git a/devices/__init__.py b/devices/__init__.py index 9e7491b..03d6553 100644 --- a/devices/__init__.py +++ b/devices/__init__.py @@ -43,6 +43,7 @@ from devices.silvercrest import silvercrest_motion_sensor from devices.mydevices import powerplug as my_powerplug from devices.mydevices import audio_status from devices.mydevices import remote +my_ambient = None class group(object): diff --git a/function/first_floor_east.py b/function/first_floor_east.py index c91e3eb..c0ecbc4 100644 --- a/function/first_floor_east.py +++ b/function/first_floor_east.py @@ -191,6 +191,8 @@ class first_floor_east_sleep(room): self.heating_valve = pd.get(props.STG_ZFE, loc, roo, props.FUN_HEA) # button self.button_tradfri = pd.get(props.STG_ZFE, loc, roo, props.FUN_INP) + # wardrobe light + self.wardrobe_light = pd.get(props.STG_ZFE, loc, roo, props.FUN_WLI) super().__init__(mqtt_client, pd, vd) @@ -248,6 +250,11 @@ class first_floor_east_sleep(room): mqtt_client, config.TOPIC_FFE_SLEEP_ACTIVE_BRIGHTNESS_DEVICE_VIDEV, brightness_choose_n_action.KEY_ACTIVE_DEVICE, self.brightness_functions, 2 ) + self.wardrobe_light_videv = videv_switch_brightness( + mqtt_client, config.TOPIC_FFE_SLEEP_WARDROBE_LIGHT_VIDEV, + self.wardrobe_light, self.wardrobe_light.KEY_OUTPUT_0, + self.wardrobe_light, self.wardrobe_light.KEY_BRIGHTNESS, + ) class first_floor_east_living(room): diff --git a/function/garden.py b/function/garden.py index cf8b42c..d70519e 100644 --- a/function/garden.py +++ b/function/garden.py @@ -32,7 +32,11 @@ class garden_garden(room): # self.day_events = day_event((6, 0), (22, 0), 30, -30) + # garden powerplugs self.garland_powerplug = pd.get(props.STG_ZGW, loc, roo, props.FUN_GAR) + # repeater + self.repeater = pd.get(props.STG_ZGW, loc, roo, props.FUN_REP) + super().__init__(mqtt_client, pd, vd) # @@ -52,6 +56,11 @@ class garden_garden(room): mqtt_client, config.TOPIC_GAR_GARDEN_GARLAND_VIDEV, self.garland_powerplug, self.garland_powerplug.KEY_OUTPUT_0 ) + # repeater + self.repeater_videv = videv_switching( + mqtt_client, config.TOPIC_GAR_GARDEN_REPEATER_VIDEV, + self.repeater, self.repeater.KEY_OUTPUT_0 + ) def __day_events__(self, device, key, data): if self.mode_videv.get(self.mode_videv.KEY_STATE): diff --git a/topics.py b/topics.py index 5baa3d8..f11f1fe 100644 --- a/topics.py +++ b/topics.py @@ -25,8 +25,9 @@ TOPIC_GFW_DIRK_AUDIO_PLAYER_VIDEV = "videv/gfw/dirk/audio_player" TOPIC_GFW_DIRK_HEATING_VALVE_VIDEV = "videv/gfw/dirk/heating_valve" # garden -TOPIC_GAR_GARDEN_MODE_VIDEV = 'videv/gar/garden/mode' -TOPIC_GAR_GARDEN_GARLAND_VIDEV = 'videv/gar/garden/garland' +TOPIC_GAR_GARDEN_MODE_VIDEV = "videv/gar/garden/mode" +TOPIC_GAR_GARDEN_GARLAND_VIDEV = "videv/gar/garden/garland" +TOPIC_GAR_GARDEN_REPEATER_VIDEV = "videv/gar/garden/repeater" # first floor west # julian @@ -66,6 +67,7 @@ TOPIC_FFE_SLEEP_BED_LIGHT_DI_VIDEV = "videv/ffe/sleep/bed_light_di" TOPIC_FFE_SLEEP_BED_LIGHT_MA_VIDEV = "videv/ffe/sleep/bed_light_ma" TOPIC_FFE_SLEEP_ACTIVE_BRIGHTNESS_DEVICE_VIDEV = "videv/ffe/sleep/active_brightness_device" TOPIC_FFE_SLEEP_HEATING_VALVE_VIDEV = "videv/ffe/sleep/heating_valve" +TOPIC_FFE_SLEEP_WARDROBE_LIGHT_VIDEV = "videv/ffe/sleep/wardrobe_light" # livingroom TOPIC_FFE_LIVINGROOM_MAIN_LIGHT_VIDEV = "videv/ffe/livingroom/main_light"