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

feat (smartplugv2_energyv2): add refresh button

dp 66 is listed as read-write in issue #909 where it was introduced
from, and after experience with other devices, we now know this is not
just an indicator, but controls whether the device sends frequent updates
of sensors.

Discussion #2654
Jason Rumney 7 месяцев назад
Родитель
Сommit
b707f5fe8b
1 измененных файлов с 21 добавлено и 0 удалено
  1. 21 0
      custom_components/tuya_local/devices/smartplugv2_energyv2.yaml

+ 21 - 0
custom_components/tuya_local/devices/smartplugv2_energyv2.yaml

@@ -183,6 +183,27 @@ entities:
             value: locator
             value: locator
           - dps_val: "on"
           - dps_val: "on"
             value: "on"
             value: "on"
+  - entity: button
+    name: Refresh
+    icon: "mdi:refresh"
+    hidden: unavailable
+    category: config
+    dps:
+      - id: 66
+        type: string
+        optional: true
+        name: available
+        mapping:
+          - dps_val: null
+            value: false
+          - value: true
+      - id: 66
+        type: string
+        optional: true
+        name: button
+        mapping:
+          - dps_val: online
+            value: true
   - entity: binary_sensor
   - entity: binary_sensor
     name: Online
     name: Online
     class: connectivity
     class: connectivity