Use UnitOfLength in integrations (#84034)

This commit is contained in:
epenet 2022-12-15 12:42:53 +01:00 committed by GitHub
parent bf4c399b19
commit d72c28a135
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 106 additions and 119 deletions

View file

@ -15,8 +15,8 @@ from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
ELECTRIC_CURRENT_AMPERE,
ENERGY_KILO_WATT_HOUR,
LENGTH_KILOMETERS,
PERCENTAGE,
UnitOfLength,
UnitOfPower,
)
from homeassistant.core import HomeAssistant
@ -86,7 +86,7 @@ SENSOR_TYPES: dict[str, WallboxSensorEntityDescription] = {
icon="mdi:map-marker-distance",
name="Added Range",
precision=0,
native_unit_of_measurement=LENGTH_KILOMETERS,
native_unit_of_measurement=UnitOfLength.KILOMETERS,
device_class=SensorDeviceClass.DISTANCE,
state_class=SensorStateClass.TOTAL_INCREASING,
),