Add device classes in starline (#84049)

This commit is contained in:
epenet 2022-12-17 09:52:59 +01:00 committed by GitHub
parent 9f10bd46ac
commit 2d9095263e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,10 +10,10 @@ from homeassistant.components.sensor import (
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
ELECTRIC_POTENTIAL_VOLT,
PERCENTAGE,
TEMP_CELSIUS,
UnitOfElectricPotential,
UnitOfLength,
UnitOfTemperature,
UnitOfVolume,
)
from homeassistant.core import HomeAssistant
@ -43,7 +43,8 @@ SENSOR_TYPES: tuple[StarlineSensorEntityDescription, ...] = (
StarlineSensorEntityDescription(
key="battery",
name_="Battery",
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
device_class=SensorDeviceClass.VOLTAGE,
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
),
StarlineSensorEntityDescription(
key="balance",
@ -54,13 +55,13 @@ SENSOR_TYPES: tuple[StarlineSensorEntityDescription, ...] = (
key="ctemp",
name_="Interior Temperature",
device_class=SensorDeviceClass.TEMPERATURE,
native_unit_of_measurement=TEMP_CELSIUS,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
),
StarlineSensorEntityDescription(
key="etemp",
name_="Engine Temperature",
device_class=SensorDeviceClass.TEMPERATURE,
native_unit_of_measurement=TEMP_CELSIUS,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
),
StarlineSensorEntityDescription(
key="gsm_lvl",