ソースを参照

Grid Connect double plug: Allow switches to function when master is off.

Current behaviour is too strict, master in this device seems like just a way to switch both at once, master automatically turns on if either of the switches is turned on so it needn't block the other switches from working.

Issue #212
Jason Rumney 3 年 前
コミット
05f30727cc

+ 0 - 10
custom_components/tuya_local/devices/grid_connect_usb_double_power_point.yaml

@@ -72,11 +72,6 @@ secondary_entities:
       - id: 1
         name: switch
         type: boolean
-        mapping:
-          - constraint: master
-            conditions:
-              - dps_val: false
-                invalid: true
       - id: 9
         name: countdown
         type: integer
@@ -91,11 +86,6 @@ secondary_entities:
       - id: 2
         name: switch
         type: boolean
-        mapping:
-          - constraint: master
-            conditions:
-              - dps_val: false
-                invalid: true
       - id: 10
         name: countdown
         type: integer

+ 0 - 9
tests/devices/test_grid_connect_double_power_point.py

@@ -148,15 +148,6 @@ class TestGridConnectDoubleSwitch(
             ],
         )
 
-    async def test_turn_on_fails_when_master_is_off(self):
-        self.dps[MASTER_DPS] = False
-        self.dps[SWITCH1_DPS] = False
-        self.dps[SWITCH2_DPS] = False
-        with self.assertRaises(AttributeError):
-            await self.multiSwitch["switch_outlet_1"].async_turn_on()
-        with self.assertRaises(AttributeError):
-            await self.multiSwitch["switch_outlet_2"].async_turn_on()
-
     # Since we have attributes, override the default test which expects none.
     def test_multi_switch_state_attributes(self):
         self.dps[COUNTDOWN1_DPS] = 9