Sfoglia il codice sorgente

Ledvance PLABL100x25b: avoid looping when value mirroring

Avoid an infinite loop trying to resolve values between available and switch
by mirroring the raw value of switch rather than the decoded value which
can mirror back to available.

Found when investigating matching in issue #3280
Jason Rumney 1 anno fa
parent
commit
55a062ae2c

+ 12 - 2
custom_components/tuya_local/devices/ledvance_smart_plabl100x25b.yaml

@@ -20,10 +20,15 @@ entities:
         mapping:
           - dps_val: true
             value: true
-            constraint: switch
+            constraint: raw_switch
             conditions:
               - dps_val: null
                 value: false
+      - id: 51
+        type: base64
+        optional: true
+        name: raw_switch
+        hidden: true
       - id: 51
         type: base64
         mask: "000100000000000000000000"
@@ -89,10 +94,15 @@ entities:
         mapping:
           - dps_val: true
             value: true
-            constraint: switch
+            constraint: raw_switch
             conditions:
               - dps_val: null
                 value: false
+      - id: 51
+        type: base64
+        optional: true
+        name: raw_switch
+        hidden: true
       - id: 51
         type: base64
         mask: "000200000000000000000000"