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