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

feat(simple_triple_switch): add Steren SHOME-113 and SHOME-110

Both these devices share the same product id, despite having a
different number of switches. Instead of duplicating the product
id across 2 configs, move the dual switch changes to the triple
switch, and make the third switch optional to cover both devices.

Issue #5996, #5997
Jason Rumney 2 дней назад
Родитель
Сommit
06d4bb1c94

+ 0 - 27
custom_components/tuya_local/devices/simple_dual_switch_timer.yaml

@@ -4,9 +4,6 @@ products:
   - id: ittunrhd
     manufacturer: Outsmart
     model: ZS3LCBCIO
-  - id: key5ckdnys3pqgec
-    manufacturer: Steren
-    model: SHOME-110
 entities:
   - entity: switch
     translation_key: switch_x
@@ -48,27 +45,3 @@ entities:
         range:
           min: 0
           max: 86400
-  - entity: select
-    translation_key: initial_state
-    category: config
-    hidden: unavailable
-    dps:
-      - id: 14
-        type: string
-        optional: true
-        name: option
-        mapping:
-          - dps_val: "off"
-            value: "off"
-          - dps_val: "on"
-            value: "on"
-          - dps_val: memory
-            value: memory
-      - id: 14
-        type: string
-        optional: true
-        name: available
-        mapping:
-          - dps_val: null
-            value: false
-          - value: true

+ 104 - 0
custom_components/tuya_local/devices/simple_triple_switch.yaml

@@ -1,4 +1,8 @@
 name: Triple switch
+products:
+  - id: key5ckdnys3pqgec
+    manufacturer: Steren
+    model: SHOME-113
 entities:
   - entity: switch
     translation_key: switch_x
@@ -20,7 +24,107 @@ entities:
     translation_key: switch_x
     translation_placeholders:
       x: "3"
+    hidden: unavailable
     dps:
       - id: 3
         name: switch
         type: boolean
+        optional: true
+      - id: 3
+        type: boolean
+        optional: true
+        name: available
+        mapping:
+          - dps_val: null
+            value: false
+          - value: true
+  - entity: time
+    translation_key: timer_x
+    translation_placeholders:
+      x: "1"
+    category: config
+    hidden: unavailable
+    dps:
+      - id: 7
+        type: integer
+        optional: true
+        name: second
+        range:
+          min: 0
+          max: 86399
+      - id: 7
+        type: integer
+        optional: true
+        name: available
+        mapping:
+          - dps_val: null
+            value: false
+          - value: true
+  - entity: time
+    translation_key: timer_x
+    translation_placeholders:
+      x: "2"
+    category: config
+    hidden: unavailable
+    dps:
+      - id: 8
+        type: integer
+        optional: true
+        name: second
+        range:
+          min: 0
+          max: 86399
+      - id: 8
+        type: integer
+        optional: true
+        name: available
+        mapping:
+          - dps_val: null
+            value: false
+          - value: true
+  - entity: time
+    translation_key: timer_x
+    translation_placeholders:
+      x: "3"
+    category: config
+    hidden: unavailable
+    dps:
+      - id: 9
+        type: integer
+        optional: true
+        name: second
+        range:
+          min: 0
+          max: 86399
+      - id: 9
+        type: integer
+        optional: true
+        name: available
+        mapping:
+          - dps_val: null
+            value: false
+          - value: true
+  - entity: select
+    translation_key: initial_state
+    category: config
+    hidden: unavailable
+    dps:
+      - id: 14
+        type: string
+        optional: true
+        name: option
+        mapping:
+          - dps_val: "off"
+            value: "off"
+          - dps_val: "on"
+            value: "on"
+          - dps_val: memory
+            value: memory
+      - id: 14
+        type: string
+        optional: true
+        name: available
+        mapping:
+          - dps_val: null
+            value: false
+          - value: true