Ver código fonte

Improvement: All off switches only active channels off

tags/v1.0.0
Dirk Alders 1 ano atrás
pai
commit
f73ad48ba7
1 arquivos alterados com 8 adições e 4 exclusões
  1. 8
    4
      devices/__init__.py

+ 8
- 4
devices/__init__.py Ver arquivo

@@ -372,8 +372,10 @@ class shelly(base):
372 372
         if self.flash_active:
373 373
             self.all_off_requested = True
374 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 381
 class silvercrest_powerplug(base):
@@ -418,7 +420,8 @@ class silvercrest_powerplug(base):
418 420
         self.set_output_0('toggle')
419 421
 
420 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 427
 class silvercrest_motion_sensor(base):
@@ -661,7 +664,8 @@ class tradfri_light(base):
661 664
         self.set_color_temp(data)
662 665
 
663 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 671
 class tradfri_button(base):

Carregando…
Cancelar
Salvar