Explorar o código

M027 curtain: fault code is a bitfield not a boolean.

Use it consistently otherwise the matching fails.
Add the fault sensor to secondary entity list in tests.
Jason Rumney %!s(int64=3) %!d(string=hai) anos
pai
achega
454fe91142

+ 5 - 2
custom_components/tuya_local/devices/m027_curtain.yaml

@@ -90,6 +90,9 @@ secondary_entities:
     category: diagnostic
     dps:
       - id: 12
-        type: boolean
+        type: bitfield
         name: sensor
-
+        mapping:
+          - dps_val: 0
+            value: false
+          - value: true

+ 6 - 1
tests/devices/test_m027_curtain.py

@@ -55,7 +55,12 @@ class TestM027Curtains(MultiSensorTests, BasicSelectTests, TuyaDeviceTestCase):
             },
         ),
         self.mark_secondary(
-            ["sensor_travel_time", "sensor_time_remaining", "select_mode"]
+            [
+                "binary_sensor_fault",
+                "select_mode",
+                "sensor_time_remaining",
+                "sensor_travel_time",
+            ]
         )
 
     def test_device_class_is_curtain(self):