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

@ -11,9 +11,9 @@ from homeassistant.components.sensor import (
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
ELECTRIC_POTENTIAL_VOLT,
LENGTH_KILOMETERS,
PERCENTAGE,
TEMP_CELSIUS,
UnitOfLength,
UnitOfVolume,
)
from homeassistant.core import HomeAssistant
@ -80,7 +80,7 @@ SENSOR_TYPES: tuple[StarlineSensorEntityDescription, ...] = (
StarlineSensorEntityDescription(
key="mileage",
name_="Mileage",
native_unit_of_measurement=LENGTH_KILOMETERS,
native_unit_of_measurement=UnitOfLength.KILOMETERS,
device_class=SensorDeviceClass.DISTANCE,
icon="mdi:counter",
),