Explorar o código

Add scale factors to power/current/voltage readings

As per first variant of Kogan switch, the second variant also needs scaling.
Jason Rumney %!s(int64=4) %!d(string=hai) anos
pai
achega
f4ea5b440d
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      custom_components/tuya_local/devices/kogan_switch2.yaml

+ 6 - 0
custom_components/tuya_local/devices/kogan_switch2.yaml

@@ -14,11 +14,17 @@ primary_entity:
       type: integer
       name: current_a
       read-only: true
+      mapping:
+        - scale: 1000
     - id: 19
       type: integer
       name: current_power_w
       read-only: true
+      mapping:
+        - scale: 10
     - id: 20
       type: integer
       name: voltage_v
       read-only: true
+      mapping:
+        - scale: 10