Kaynağa Gözat

Loratap curtain switch

Make this match any kind of simple single DP curtain switch, whether
the controls are ("1", "2", "3"), ("open", "close", "stop"), or ("ZZ",
"FZ", "STOP").

PR #646
Jason Rumney 3 yıl önce
ebeveyn
işleme
29e91f2637

+ 29 - 8
custom_components/tuya_local/devices/loratap_curtain_switch.yaml

@@ -1,7 +1,9 @@
-name: LoraTap curtain switch
+name: Simple curtain switch
 product:
   - id: tuh2eatk4hsq336s
-    name: SC500W-V1
+    name: Loratap SC500W-V1
+  - id: hwbhrbadjynv7w70
+    name: Zemismart ZM16L
 primary_entity:
   entity: cover
   class: blind
@@ -10,9 +12,28 @@ primary_entity:
       name: control
       type: string
       mapping:
-        - dps_val: "1"
-          value: open
-        - dps_val: "2"
-          value: close
-        - dps_val: "3"
-          value: stop
+        - conditions:
+            - dps_val: [ "1", "2", "3" ]
+              mapping:
+                - dps_val: "1"
+                  value: open
+                - dps_val: "2"
+                  value: close
+                - dps_val: "3"
+                  value: stop
+            - dps_val: [ "open", "close", "stop" ]
+              mapping:
+                - dps_val: open
+                  value: open
+                - dps_val: close
+                  value: close
+                - dps_val: stop
+                  value: stop
+            - dps_val: [ "ZZ", "FZ", "STOP" ]
+              mapping:
+                - dps_val: ZZ
+                  value: open
+                - dps_val: FZ
+                  value: close
+                - dps_val: STOP
+                  value: stop