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

feat(smartplugv2_energy): mark "Energy" as a proper energy sensor

This was originally given a measurement state class and no class to
reflect that it is generally not useful for energy dashboard use with
most Tuya smartplugs.

But now it is hidden by default, so allow users to use it as an energy
sensor if they enable it in their installation, for those rare devices
that actually work properly.

PR #4723
Jason Rumney 2 месяцев назад
Родитель
Сommit
fd5297fbce
1 измененных файлов с 5 добавлено и 2 удалено
  1. 5 2
      custom_components/tuya_local/devices/smartplugv2_energy.yaml

+ 5 - 2
custom_components/tuya_local/devices/smartplugv2_energy.yaml

@@ -21,6 +21,9 @@ products:
   - id: pq860vo9ib50jhud
     manufacturer: Positivo
     model: 10A CTD
+  - id: i4fg8sszym1rtqz7
+    manufacturer: Voltcraft
+    model: SEM6500
 entities:
   - entity: switch
     class: outlet
@@ -63,13 +66,13 @@ entities:
   - entity: sensor
     category: diagnostic
     hidden: true
-    name: Energy
+    class: energy
     dps:
       - id: 17
         name: sensor
         type: integer
         unit: Wh
-        class: measurement
+        class: total_increasing
         optional: true
       - id: 25
         type: integer