Przeglądaj źródła

Safe conn09 barrier: use Relay to determine if the barrier is moving

PR #3295
Jason Rumney 1 rok temu
rodzic
commit
5061125530

+ 19 - 8
custom_components/tuya_local/devices/safe_conn09_barrier.yaml

@@ -16,8 +16,26 @@ entities:
           - dps_val: false
             value: "close"
       - id: 103
-        name: open
+        name: open_state
         type: boolean
+      - id: 102
+        type: boolean
+        name: action
+        mapping:
+          - dps_val: true
+            constraint: control
+            conditions:
+              - dps_val: true
+                value: opening
+              - dps_val: false
+                value: closing
+          - dps_val: false
+            constraint: open_state
+            conditions:
+              - dps_val: true
+                value: opened
+              - dps_val: false
+                value: closed
   - entity: switch
     translation_key: keytone
     category: config
@@ -25,13 +43,6 @@ entities:
       - id: 101
         type: boolean
         name: switch
-  - entity: switch
-    name: Relay
-    category: config
-    dps:
-      - id: 102
-        type: boolean
-        name: switch
   - entity: number
     name: Relay engage time
     class: duration