Просмотр исходного кода

fix(loonas_curtain): do not invert direction when reverse is set

Not sure if this behaviour is universal with Tuya covers, but at least on
the device in #5486, when set to reverse, the positions are inverted when
reported by the device itself (so match the HA expectation without inverting)
Jason Rumney 1 неделя назад
Родитель
Сommit
dcf18a6864
1 измененных файлов с 17 добавлено и 2 удалено
  1. 17 2
      custom_components/tuya_local/devices/loonas_curtain.yaml

+ 17 - 2
custom_components/tuya_local/devices/loonas_curtain.yaml

@@ -42,7 +42,12 @@ entities:
           min: 0
           max: 100
         mapping:
-          - invert: true
+          - constraint: direction
+            conditions:
+              - dps_val: null
+                invert: true
+              - dps_val: forward
+                invert: true
       - id: 3
         name: current_position
         type: integer
@@ -51,7 +56,17 @@ entities:
           min: 0
           max: 100
         mapping:
-          - invert: true
+          - constraint: direction
+            conditions:
+              - dps_val: null
+                invert: true
+              - dps_val: forward
+                invert: true
+      - id: 5
+        type: string
+        optional: true
+        name: direction
+        hidden: true  # exposed as switch below
       - id: 7
         name: work_state
         type: string