diff --git a/function/__init__.py b/function/__init__.py index 307425c..60b9f86 100644 --- a/function/__init__.py +++ b/function/__init__.py @@ -39,6 +39,9 @@ class all_functions(object): # # Interactions # + # shelly dirk input 1 + self.last_gfw_dirk_input_1 = None + self.gfw_dirk.main_light_shelly.add_callback(devices.shelly.KEY_INPUT_1, None, self.gfw_dirk_input_1) # input device self.init_input_device_sleep_madi_functionality() # Circulation pump @@ -64,6 +67,12 @@ class all_functions(object): self.common_circulation_pump.main_light_shelly.add_callback( devices.shelly.KEY_OUTPUT_0, None, self.ffe_kitchen.flash_main_light) + 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.toggle_main_light(device, key, data) + self.last_gfw_dirk_input_1 = data + def devicelist(self): if self.__devices__ is None: self.__devices__ = []