Sfoglia il codice sorgente

Rename current and voltage attributes.

Looking at other integrations for power monitoring switches, it seems more standard to include the units.
Jason Rumney 5 anni fa
parent
commit
a75eb1c693
1 ha cambiato i file con 3 aggiunte e 5 eliminazioni
  1. 3 5
      custom_components/tuya_local/kogan_socket/const.py

+ 3 - 5
custom_components/tuya_local/kogan_socket/const.py

@@ -1,11 +1,9 @@
-from homeassistant.components.switch import (
-    ATTR_CURRENT_POWER_W,
-)
+from homeassistant.components.switch import ATTR_CURRENT_POWER_W
 
 ATTR_SWITCH = "switch"
 ATTR_TIMER = "timer"
-ATTR_CURRENT_A = "current"
-ATTR_VOLTAGE_V = "voltage"
+ATTR_CURRENT_A = "current_a"
+ATTR_VOLTAGE_V = "voltage_v"
 
 PROPERTY_TO_DPS_ID = {
     ATTR_SWITCH: "1",