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

feat(aubess_1gang_switch): add compatible Moes WM-104-M

Split out switch type to select entity so it can be controlled.
Before we didn't have the full spec for that.

Issue #5258
Jason Rumney 1 месяц назад
Родитель
Сommit
5c64e8f5e2
1 измененных файлов с 27 добавлено и 4 удалено
  1. 27 4
      custom_components/tuya_local/devices/aubess_1gang_switch.yaml

+ 27 - 4
custom_components/tuya_local/devices/aubess_1gang_switch.yaml

@@ -5,6 +5,9 @@ products:
     model: Smart Switch/EM
   - id: m4jtkjc43ltrilru
     model: T34 Smart Plug+
+  - id: apwf3sfwz51xuvht
+    manufacturer: Moes
+    model: WM-104-M
 entities:
   - entity: switch
     dps:
@@ -27,10 +30,6 @@ entities:
         name: switch_inching
         type: string
         optional: true
-      - id: 47
-        type: string
-        name: switch_type
-        optional: true
   - entity: time
     translation_key: timer
     category: config
@@ -171,3 +170,27 @@ entities:
         type: bitfield
         optional: true
         name: fault_code
+  - entity: select
+    name: Switch type
+    icon: "mdi:toggle-switch"
+    category: config
+    dps:
+      - id: 47
+        type: string
+        optional: true
+        name: option
+        mapping:
+          - dps_val: sync
+            value: Synchronized switch
+          - dps_val: flip
+            value: Toggle switch
+          - dps_val: button
+            value: Momentary button
+      - id: 47
+        type: string
+        optional: true
+        name: available
+        mapping:
+          - dps_val: null
+            value: false
+          - value: true