Use UnitOfElectricCurrent in integrations (#83622)
This commit is contained in:
parent
cc132bfad6
commit
7c3ca38eb7
25 changed files with 80 additions and 82 deletions
|
@ -14,11 +14,11 @@ from homeassistant.components.sensor import (
|
|||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import (
|
||||
ELECTRIC_CURRENT_AMPERE,
|
||||
ELECTRIC_POTENTIAL_VOLT,
|
||||
PERCENTAGE,
|
||||
POWER_KILO_WATT,
|
||||
TIME_MINUTES,
|
||||
UnitOfElectricCurrent,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
|
@ -666,7 +666,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
|
|||
key=DPCode.PHASE_A,
|
||||
name="Phase A current",
|
||||
device_class=SensorDeviceClass.CURRENT,
|
||||
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
|
||||
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
subkey="electriccurrent",
|
||||
),
|
||||
|
@ -690,7 +690,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
|
|||
key=DPCode.PHASE_B,
|
||||
name="Phase B current",
|
||||
device_class=SensorDeviceClass.CURRENT,
|
||||
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
|
||||
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
subkey="electriccurrent",
|
||||
),
|
||||
|
@ -714,7 +714,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
|
|||
key=DPCode.PHASE_C,
|
||||
name="Phase C current",
|
||||
device_class=SensorDeviceClass.CURRENT,
|
||||
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
|
||||
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
subkey="electriccurrent",
|
||||
),
|
||||
|
@ -748,7 +748,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
|
|||
key=DPCode.PHASE_A,
|
||||
name="Phase A current",
|
||||
device_class=SensorDeviceClass.CURRENT,
|
||||
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
|
||||
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
subkey="electriccurrent",
|
||||
),
|
||||
|
@ -772,7 +772,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
|
|||
key=DPCode.PHASE_B,
|
||||
name="Phase B current",
|
||||
device_class=SensorDeviceClass.CURRENT,
|
||||
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
|
||||
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
subkey="electriccurrent",
|
||||
),
|
||||
|
@ -796,7 +796,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
|
|||
key=DPCode.PHASE_C,
|
||||
name="Phase C current",
|
||||
device_class=SensorDeviceClass.CURRENT,
|
||||
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
|
||||
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
subkey="electriccurrent",
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue