Explorar o código

Invert the meaning of reversed.

It seems Tuya and Home Assistant have opposing views on what is normal
and what is reversed.  To make the behaviour consistent we need to
convert to Home Assistant's view, otherwise the reversed switch just
toggles between two different opposing views of the state Home Assistant
sees and the behaviour that Tuya has.
Jason Rumney %!s(int64=3) %!d(string=hai) anos
pai
achega
c3d78509bc
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      custom_components/tuya_local/devices/wistar_roller_blind.yaml

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

@@ -32,6 +32,11 @@ primary_entity:
     - id: 103
       type: boolean
       name: reversed
+      mapping:
+        - dps_val: true
+          value: false
+        - dps_val: false
+          value: true
     - id: 105
       type: boolean
       name: curtain_hand
@@ -147,3 +152,8 @@ secondary_entities:
       - id: 103
         type: boolean
         name: switch
+        mapping:
+          - dps_val: true
+            value: false
+          - dps_val: false
+            value: true