Use native unit of measurement in deCONZ sensors (#56897)

This commit is contained in:
Robert Svensson 2021-10-01 16:50:09 +02:00 committed by GitHub
parent ab037383ed
commit 369412547a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -70,13 +70,13 @@ ENTITY_DESCRIPTIONS = {
key="battery", key="battery",
device_class=DEVICE_CLASS_BATTERY, device_class=DEVICE_CLASS_BATTERY,
state_class=STATE_CLASS_MEASUREMENT, state_class=STATE_CLASS_MEASUREMENT,
unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
), ),
Consumption: SensorEntityDescription( Consumption: SensorEntityDescription(
key="consumption", key="consumption",
device_class=DEVICE_CLASS_ENERGY, device_class=DEVICE_CLASS_ENERGY,
state_class=STATE_CLASS_TOTAL_INCREASING, state_class=STATE_CLASS_TOTAL_INCREASING,
unit_of_measurement=ENERGY_KILO_WATT_HOUR, native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
), ),
Daylight: SensorEntityDescription( Daylight: SensorEntityDescription(
key="daylight", key="daylight",
@ -87,30 +87,30 @@ ENTITY_DESCRIPTIONS = {
key="humidity", key="humidity",
device_class=DEVICE_CLASS_HUMIDITY, device_class=DEVICE_CLASS_HUMIDITY,
state_class=STATE_CLASS_MEASUREMENT, state_class=STATE_CLASS_MEASUREMENT,
unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
), ),
LightLevel: SensorEntityDescription( LightLevel: SensorEntityDescription(
key="lightlevel", key="lightlevel",
device_class=DEVICE_CLASS_ILLUMINANCE, device_class=DEVICE_CLASS_ILLUMINANCE,
unit_of_measurement=LIGHT_LUX, native_unit_of_measurement=LIGHT_LUX,
), ),
Power: SensorEntityDescription( Power: SensorEntityDescription(
key="power", key="power",
device_class=DEVICE_CLASS_POWER, device_class=DEVICE_CLASS_POWER,
state_class=STATE_CLASS_MEASUREMENT, state_class=STATE_CLASS_MEASUREMENT,
unit_of_measurement=POWER_WATT, native_unit_of_measurement=POWER_WATT,
), ),
Pressure: SensorEntityDescription( Pressure: SensorEntityDescription(
key="pressure", key="pressure",
device_class=DEVICE_CLASS_PRESSURE, device_class=DEVICE_CLASS_PRESSURE,
state_class=STATE_CLASS_MEASUREMENT, state_class=STATE_CLASS_MEASUREMENT,
unit_of_measurement=PRESSURE_HPA, native_unit_of_measurement=PRESSURE_HPA,
), ),
Temperature: SensorEntityDescription( Temperature: SensorEntityDescription(
key="temperature", key="temperature",
device_class=DEVICE_CLASS_TEMPERATURE, device_class=DEVICE_CLASS_TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT, state_class=STATE_CLASS_MEASUREMENT,
unit_of_measurement=TEMP_CELSIUS, native_unit_of_measurement=TEMP_CELSIUS,
), ),
} }