Browse Source

Improvement: All off switches only active channels off

tags/v1.0.0
Dirk Alders 1 year ago
parent
commit
f73ad48ba7
1 changed files with 8 additions and 4 deletions
  1. 8
    4
      devices/__init__.py

+ 8
- 4
devices/__init__.py View File

372
         if self.flash_active:
372
         if self.flash_active:
373
             self.all_off_requested = True
373
             self.all_off_requested = True
374
         else:
374
         else:
375
-            self.set_output_0(False)
376
-            self.set_output_1(False)
375
+            if self.output_0:
376
+                self.set_output_0(False)
377
+            if self.output_1:
378
+                self.set_output_1(False)
377
 
379
 
378
 
380
 
379
 class silvercrest_powerplug(base):
381
 class silvercrest_powerplug(base):
418
         self.set_output_0('toggle')
420
         self.set_output_0('toggle')
419
 
421
 
420
     def all_off(self):
422
     def all_off(self):
421
-        self.set_output_0(False)
423
+        if self.output_0:
424
+            self.set_output_0(False)
422
 
425
 
423
 
426
 
424
 class silvercrest_motion_sensor(base):
427
 class silvercrest_motion_sensor(base):
661
         self.set_color_temp(data)
664
         self.set_color_temp(data)
662
 
665
 
663
     def all_off(self):
666
     def all_off(self):
664
-        self.set_output_0(False)
667
+        if self.output_0:
668
+            self.set_output_0(False)
665
 
669
 
666
 
670
 
667
 class tradfri_button(base):
671
 class tradfri_button(base):

Loading…
Cancel
Save