From 881bc13c5a454407deeaf9f3303852e55412ac0d Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Thu, 28 Aug 2025 15:38:24 +0200 Subject: [PATCH] Added devices for gfw --- rooms.py | 29 ++++++++++++++++++----------- topic.py | 3 +++ 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/rooms.py b/rooms.py index 2e3e9ea..dcb2d81 100644 --- a/rooms.py +++ b/rooms.py @@ -57,7 +57,7 @@ The device names in the room classes follow this definition: switch_circulation_pump videv_circulation_pump - my_powerplug + switch_powerplug_4 videv_amplifier videv_cd_player videv_bluetooth @@ -108,6 +108,7 @@ from devices import videv_sw_tm from devices import videv_hea from devices import videv_pure_switch from devices import videv_multistate +from devices import videv_audio_player # # try: @@ -168,7 +169,7 @@ class ffe_kitchen(base_room): # # http://shelly1l-8CAAB5616C01 self.switch_main_light = shelly_sw1(mqtt_client, get_topic(props.STG_SHE, loc, roo, props.FUN_MAL)) - self.light_main_light = self.__get_group__(hue_sw_br_ct, mqtt_client, props.STG_ZFE, loc, roo, props.FUN_MAL, 2) + self.light_main_light: hue_sw_br_ct = self.__get_group__(hue_sw_br_ct, mqtt_client, props.STG_ZFE, loc, roo, props.FUN_MAL, 2) self.videv_main_light = videv_sw_br_ct(mqtt_client, get_topic(props.STG_VDE, loc, roo, props.FUN_MAL)) # http://shelly1-e89f6d85a466 @@ -189,7 +190,7 @@ class ffe_livingroom(base_room): self.light_main_light = tradfri_sw_br_ct(mqtt_client, get_topic(props.STG_ZFE, loc, roo, props.FUN_MAL)) self.videv_main_light = videv_sw_br_ct(mqtt_client, get_topic(props.STG_VDE, loc, roo, props.FUN_MAL)) - self.light_floor_light = self.__get_group__(tradfri_sw_br_ct, mqtt_client, props.STG_ZFE, loc, roo, props.FUN_FLL, 6) + self.light_floor_light: tradfri_sw_br_ct = self.__get_group__(tradfri_sw_br_ct, mqtt_client, props.STG_ZFE, loc, roo, props.FUN_FLL, 6) self.videv_floor_light = videv_sw_br_ct(mqtt_client, get_topic(props.STG_VDE, loc, roo, props.FUN_FLL)) self.valve_heating = brennenstuhl_heatingvalve(mqtt_client, get_topic(props.STG_ZFE, loc, roo, props.FUN_HEA)) @@ -334,12 +335,18 @@ class gfw_dirk(base_room): self.videv_main_light = videv_sw_br_ct(mqtt_client, get_topic(props.STG_VDE, loc, roo, props.FUN_MAL)) self.input_device = tradfri_button(mqtt_client, get_topic(props.STG_ZGW, loc, roo, props.FUN_INP)) + self.videv_multistate = videv_multistate(mqtt_client, get_topic(props.STG_VDE, loc, roo, props.FUN_VMS)) + + self.switch_powerplug_4 = my_powerplug(mqtt_client, get_topic(props.STG_MYA, loc, roo, props.FUN_MPP)) + self.KEY_POWERPLUG_AMPLIFIER = self.switch_powerplug_4.KEY_OUTPUT_0 + self.KEY_POWERPLUG_PHONO = self.switch_powerplug_4.KEY_OUTPUT_1 + self.KEY_POWERPLUG_CD_PLAYER = self.switch_powerplug_4.KEY_OUTPUT_2 + self.KEY_POWERPLUG_BT = self.switch_powerplug_4.KEY_OUTPUT_3 + self.switch_powerplug_4.set_ch_name(self.KEY_POWERPLUG_AMPLIFIER, "amplifier") + self.switch_powerplug_4.set_ch_name(self.KEY_POWERPLUG_PHONO, "phono") + self.switch_powerplug_4.set_ch_name(self.KEY_POWERPLUG_CD_PLAYER, "cd-player") + self.switch_powerplug_4.set_ch_name(self.KEY_POWERPLUG_BT, "bluetooth") - self.my_powerplug = my_powerplug(mqtt_client, get_topic(props.STG_MYA, loc, roo, props.FUN_MPP)) - self.my_powerplug.set_ch_name(self.my_powerplug.KEY_OUTPUT_0, "amplifier") - self.my_powerplug.set_ch_name(self.my_powerplug.KEY_OUTPUT_1, "phono") - self.my_powerplug.set_ch_name(self.my_powerplug.KEY_OUTPUT_2, "cd-player") - self.my_powerplug.set_ch_name(self.my_powerplug.KEY_OUTPUT_3, "bluetooth") self.videv_amplifier = videv_sw(mqtt_client, get_topic(props.STG_VDE, loc, roo, props.FUN_AMP)) self.videv_cd_player = videv_sw(mqtt_client, get_topic(props.STG_VDE, loc, roo, props.FUN_CDP)) self.videv_bluetooth = videv_sw(mqtt_client, get_topic(props.STG_VDE, loc, roo, props.FUN_BTP)) @@ -348,14 +355,14 @@ class gfw_dirk(base_room): self.light_desk_light = tradfri_sw_br_ct(mqtt_client, get_topic(props.STG_ZGW, loc, roo, props.FUN_DEL)) self.videv_desk_light = videv_sw_br_ct(mqtt_client, get_topic(props.STG_VDE, loc, roo, props.FUN_DEL)) - self.switch_pc_dock = tradfri_sw(mqtt_client, get_topic(props.STG_ZGW, loc, roo, props.FUN_DCK)) + self.switch_pc_dock = silvercrest_powerplug(mqtt_client, get_topic(props.STG_ZGW, loc, roo, props.FUN_DCK)) self.videv_pc_dock = videv_sw(mqtt_client, get_topic(props.STG_VDE, loc, roo, props.FUN_DCK)) self.remote_ctrl = remote(mqtt_client, get_topic(props.STG_MYA, loc, roo, props.FUN_RCA)) - self.audio_status_spotify = audio_status(mqtt_client, get_topic(props.STG_MYA, loc, roo, props.FUN_ASS)) self.audio_status_mpd = audio_status(mqtt_client, get_topic(props.STG_MYA, loc, roo, props.FUN_ASM)) self.audio_status_bluetooth = audio_status(mqtt_client, get_topic(props.STG_MYA, loc, roo, props.FUN_ASB)) + self.videv_audio_player = videv_audio_player(mqtt_client, get_topic(props.STG_VDE, loc, roo, props.FUN_VAU)) self.valve_heating = brennenstuhl_heatingvalve(mqtt_client, get_topic(props.STG_ZGW, loc, roo, props.FUN_HEA)) self.ambient_info = my_ambient(mqtt_client, get_topic(props.STG_MYA, loc, roo, props.FUN_AMB)) @@ -369,7 +376,7 @@ class gfw_floor(base_room): # # http://shelly1l-84CCA8AD1148 self.switch_main_light = shelly_sw1(mqtt_client, get_topic(props.STG_SHE, loc, roo, props.FUN_MAL)) - self.light_main_light = self.__get_group__(tradfri_sw_br_ct, mqtt_client, props.STG_ZGW, loc, roo, props.FUN_MAL, 2) + self.light_main_light: tradfri_sw_br_ct = self.__get_group__(tradfri_sw_br_ct, mqtt_client, props.STG_ZGW, loc, roo, props.FUN_MAL, 2) self.videv_main_light = videv_sw_br_ct(mqtt_client, get_topic(props.STG_VDE, loc, roo, props.FUN_MAL)) diff --git a/topic.py b/topic.py index e0d13ee..a21c581 100644 --- a/topic.py +++ b/topic.py @@ -157,6 +157,8 @@ FUN_VMS = 28 """ Virtual Multi State""" FUN_MOD = 29 """ Mode """ +FUN_VAU = 30 +""" Virtual Audio player status """ STG_TOPIC = { @@ -222,6 +224,7 @@ FUN_TOPIC = { FUN_PHO: 'phono', FUN_VMS: 'active_brightness_device', FUN_MOD: 'mode', + FUN_VAU: 'audio_player' }