Parcourir la source

Somgom single switch: use different option groups for initial state

To match other brands using the same dps layout, the initial state needs
to accept both "0", "1", "2" values and the common "off", "on", "memory"
values.

Issue #962
Jason Rumney il y a 2 ans
Parent
commit
18ed70d954
1 fichiers modifiés avec 19 ajouts et 6 suppressions
  1. 19 6
      custom_components/tuya_local/devices/somgom_single_switch.yaml

+ 19 - 6
custom_components/tuya_local/devices/somgom_single_switch.yaml

@@ -2,6 +2,8 @@ name: Wall switch
 products:
 products:
   - id: nqodepctqralr6su
   - id: nqodepctqralr6su
     name: Novadigital switch
     name: Novadigital switch
+  - id: vxo9yezswiumvync
+    name: PST WT-E1
 primary_entity:
 primary_entity:
   entity: switch
   entity: switch
   dps:
   dps:
@@ -33,12 +35,23 @@ secondary_entities:
         name: option
         name: option
         optional: true
         optional: true
         mapping:
         mapping:
-          - dps_val: "0"
-            value: "Off"
-          - dps_val: "1"
-            value: "On"
-          - dps_val: "2"
-            value: Last state
+          conditions:
+            - dps_val: ["0", "1", "2"]
+              mapping:
+                - dps_val: "0"
+                  value: "Off"
+                - dps_val: "1"
+                  value: "On"
+                - dps_val: "2"
+                  value: Last state
+            - dps_val: ["memory", "off", "on"]
+              mapping:
+                - dps_val: "off"
+                  value: "Off"
+                - dps_val: "on"
+                  value: "On"
+                - dps_val: memory
+                  value: Last state
   - entity: light
   - entity: light
     name: Backlight
     name: Backlight
     category: config
     category: config