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

fix(atorch_s1bw_smartplug): dp 1 is a sensor, promote switch state

Switch can only be controlled by the "Switch state" select entity, so
promote that to a control instead of config.
Change the dp 1 switch to a binary_sensor, and demote to diagnostic.

Issue #3253 comment
Jason Rumney 8 месяцев назад
Родитель
Сommit
910e4b61c4
1 измененных файлов с 4 добавлено и 11 удалено
  1. 4 11
      custom_components/tuya_local/devices/atorch_s1bw_smartplug.yaml

+ 4 - 11
custom_components/tuya_local/devices/atorch_s1bw_smartplug.yaml

@@ -4,20 +4,14 @@ products:
     manufacturer: Atorch
     model: S1BW
 entities:
-  - entity: switch
-    class: outlet
+  - entity: binary_sensor
+    class: power
+    category: diagnostic
     dps:
       - id: 1
         type: boolean
-        name: switch
+        name: sensor
         optional: true
-      - id: 131
-        type: string
-        name: available
-        mapping:
-          - dps_val: auto
-            value: false
-          - value: true
   - entity: number
     category: config
     class: duration
@@ -422,7 +416,6 @@ entities:
           min: 60
           max: 359940
   - entity: select
-    category: config
     name: Switch state
     dps:
       - id: 131