From f73ad48ba79b2aeac6069d156e3554ceabac9fd3 Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Mon, 6 Feb 2023 14:58:34 +0100 Subject: [PATCH] Improvement: All off switches only active channels off --- devices/__init__.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/devices/__init__.py b/devices/__init__.py index 741b8eb..e6efd87 100644 --- a/devices/__init__.py +++ b/devices/__init__.py @@ -372,8 +372,10 @@ class shelly(base): if self.flash_active: self.all_off_requested = True else: - self.set_output_0(False) - self.set_output_1(False) + if self.output_0: + self.set_output_0(False) + if self.output_1: + self.set_output_1(False) class silvercrest_powerplug(base): @@ -418,7 +420,8 @@ class silvercrest_powerplug(base): self.set_output_0('toggle') def all_off(self): - self.set_output_0(False) + if self.output_0: + self.set_output_0(False) class silvercrest_motion_sensor(base): @@ -661,7 +664,8 @@ class tradfri_light(base): self.set_color_temp(data) def all_off(self): - self.set_output_0(False) + if self.output_0: + self.set_output_0(False) class tradfri_button(base):