소스 검색

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 년 전
부모
커밋
89902b920d
1개의 변경된 파일14개의 추가작업 그리고 0개의 파일을 삭제
  1. 14 0
      custom_components/tuya_local/devices/tongou_qcb2_singlephasebreaker.yaml

+ 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