mirror of
https://github.com/Andre0512/hon.git
synced 2025-03-01 02:26:53 +00:00
bug: unit of measurament
This is the warning showed in the registry log: (<class 'custom_components.hon.sensor.HonSensorEntity'>) is using native unit of measurement 'kWh' which is not a valid unit for the device class ('power') it is using; expected one of ['W', 'kW', 'TW', 'GW', 'MW'];
This commit is contained in:
parent
70eb6c0111
commit
67bce169ee
|
@ -18,6 +18,7 @@ from homeassistant.const import (
|
|||
UnitOfEnergy,
|
||||
UnitOfVolume,
|
||||
UnitOfMass,
|
||||
UnitOfPower,
|
||||
UnitOfTime,
|
||||
UnitOfTemperature,
|
||||
)
|
||||
|
@ -83,7 +84,7 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = {
|
|||
name="Current Electricity Used",
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
device_class=SensorDeviceClass.POWER,
|
||||
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||
native_unit_of_measurement=UnitOfPower.WATT,
|
||||
icon="mdi:lightning-bolt",
|
||||
translation_key="energy_current",
|
||||
),
|
||||
|
|
Loading…
Reference in a new issue