From 713bf4d01777b1b8243d29037624419dd40886c3 Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Thu, 22 Dec 2022 08:10:56 +0100 Subject: [PATCH] added additional devices to all off functionality --- function/first_floor_east.py | 11 ++++++++++- function/ground_floor_west.py | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/function/first_floor_east.py b/function/first_floor_east.py index 37b0ca4..b807d28 100644 --- a/function/first_floor_east.py +++ b/function/first_floor_east.py @@ -47,6 +47,10 @@ class first_floor_east_dining(room_shelly): # self.main_light_shelly_last = None + def all_off(self, device=None, key=None, data=None): + super().all_off(device, key, data) + self.floorlamp_powerplug.set_output_0(False) + def floorlamp_synchronisation(self, device, key, data): if data != self.main_light_shelly_last: logger.info("Synching \"%s\" floorlamp with main light (%s)", type(self).__name__, str(data)) @@ -91,7 +95,7 @@ class first_floor_east_sleep_madi(room_shelly_tradfri_light): self.fade_light) def all_off(self, device=None, key=None, data=None): - return super().all_off(device, key, data) + super().all_off(device, key, data) self.bed_light_di_tradfri.set_output_0(False) # bed light @@ -203,6 +207,11 @@ class first_floor_east_living(room_shelly_tradfri_light): # self.main_light_shelly_last = None + def all_off(self, device=None, key=None, data=None): + super().all_off(device, key, data) + for floorlamp in self.__floorlamp_devices__(): + floorlamp.set_output_0(False) + def __floorlamp_devices__(self): rv = [] for i in range(1, 7): diff --git a/function/ground_floor_west.py b/function/ground_floor_west.py index 07c919f..a57e26a 100644 --- a/function/ground_floor_west.py +++ b/function/ground_floor_west.py @@ -49,3 +49,6 @@ class ground_floor_west_dirk(room_shelly_tradfri_light): def __init__(self, mqtt_client): super().__init__(mqtt_client, "shellies/dirk", "gui/gfw_sw_dirk", "zigbee_eg_w/light/dirk", "gui/gfw_br_dirk", "gui/gfw_ct_dirk") + + def all_off(self, device=None, key=None, data=None): + super().all_off(device, key, data)