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

Tongou QCB2 single CB: change live updates to a button

The device does not seem to report "offline" so the switch is always indicating
"online" once used once so requires more complex automations to toggle off
and on. Making it a button simplifies that, as we do not expect a button to
maintain state.

Discussion #3041
Jason Rumney 11 месяцев назад
Родитель
Сommit
89902b920d

+ 14 - 0
custom_components/tuya_local/devices/tongou_qcb2_singlephasebreaker.yaml

@@ -147,6 +147,7 @@ entities:
   - entity: switch
     category: config
     name: Live updates
+    deprecated: button
     icon: "mdi:chart-bar"
     dps:
       - id: 109
@@ -160,6 +161,19 @@ entities:
             value: false
           - value: false
             hidden: true
+  - entity: button
+    category: config
+    name: Live updates
+    icon: "mdi:chart-bar"
+    dps:
+      - id: 109
+        type: string
+        name: button
+        optional: true
+        mapping:
+          - dps_val: online
+            value: true
+          - value: false
   - entity: event
     dps:
       - id: 110