Przeglądaj źródła

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 1 rok temu
rodzic
commit
89902b920d

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

@@ -147,6 +147,7 @@ entities:
   - entity: switch
   - entity: switch
     category: config
     category: config
     name: Live updates
     name: Live updates
+    deprecated: button
     icon: "mdi:chart-bar"
     icon: "mdi:chart-bar"
     dps:
     dps:
       - id: 109
       - id: 109
@@ -160,6 +161,19 @@ entities:
             value: false
             value: false
           - value: false
           - value: false
             hidden: true
             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
   - entity: event
     dps:
     dps:
       - id: 110
       - id: 110