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

feat (quad_power_timer): extend with more standard entities

These are following Tuya's standard layout for smart switches, and previous
models supportd by this config have nothing assigned to these dps, so
there should be no conflict.

PR #4665
Jason Rumney 1 неделя назад
Родитель
Сommit
422c338afa
1 измененных файлов с 106 добавлено и 5 удалено
  1. 106 5
      custom_components/tuya_local/devices/quad_power_timer.yaml

+ 106 - 5
custom_components/tuya_local/devices/quad_power_timer.yaml

@@ -1,5 +1,8 @@
 name: Quad powerstrip
 products:
+  - id: key5nck4tavy43jp
+    manufacturer: Xystec
+    model: NX-4686-919 4xUSB
   - id: ckg60n4x6qakegxo
     manufacturer: Xystec
     model: NX-4986-919 4xUSB
@@ -111,9 +114,107 @@ entities:
         name: option
         optional: true
         mapping:
-          - dps_val: "on"
-            value: "on"
-          - dps_val: "off"
+          - conditions:
+              - dps_val: ["memory", "on", "off"]
+                mapping:
+                  - dps_val: "on"
+                    value: "on"
+                  - dps_val: "off"
+                    value: "off"
+                  - dps_val: memory
+                    value: memory
+              - dps_val: ["power_off", "power_on", "last"]
+                mapping:
+                  - dps_val: power_on
+                    value: "on"
+                  - dps_val: power_off
+                    value: "off"
+                  - dps_val: last
+                    value: memory
+              - dps_val: ["0", "1", "2"]
+                mapping:
+                  - dps_val: "0"
+                    value: "off"
+                  - dps_val: "1"
+                    value: "on"
+                  - dps_val: "2"
+                    value: memory
+              - dps_val: null
+                mapping:
+                  - dps_val: "on"
+                    value: "on"
+                  - dps_val: "off"
+                    value: "off"
+                  - dps_val: memory
+                    value: memory
+  - entity: select
+    translation_key: light_mode
+    category: config
+    hidden: unavailable
+    dps:
+      - id: 40
+        type: string
+        optional: true
+        name: available
+        mapping:
+          - dps_val: null
+            value: false
+          - value: true
+      - id: 40
+        type: string
+        optional: true
+        name: option
+        mapping:
+          - dps_val: relay
+            value: state
+          - dps_val: pos
+            value: locator
+          - dps_val: none
             value: "off"
-          - dps_val: memory
-            value: memory
+  - entity: lock
+    translation_key: child_lock
+    category: config
+    hidden: unavailable
+    dps:
+      - id: 41
+        type: boolean
+        optional: true
+        name: lock
+      - id: 41
+        type: boolean
+        optional: true
+        name: available
+        mapping:
+          - dps_val: null
+            value: false
+          - value: true
+  - entity: text
+    name: Schedule
+    category: config
+    icon: "mdi:calendar-clock"
+    hidden: true
+    dps:
+      - id: 42
+        type: base64
+        optional: true
+        name: value
+  - entity: text
+    name: Random schedule
+    category: config
+    icon: "mdi:island"
+    hidden: true
+    dps:
+      - id: 43
+        type: base64
+        optional: true
+        name: value
+  - entity: text
+    name: Inching
+    category: config
+    icon: "mdi:toggle-switch"
+    hidden: true
+    dps:
+      - id: 44
+        type: base64
+        optional: true
+        name: value