Use new enums in starline (#62407)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2021-12-20 17:55:37 +01:00 committed by GitHub
parent bea1fbb4aa
commit ae3162bb6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 12 deletions

View file

@ -4,10 +4,7 @@ from __future__ import annotations
from dataclasses import dataclass from dataclasses import dataclass
from homeassistant.components.binary_sensor import ( from homeassistant.components.binary_sensor import (
DEVICE_CLASS_DOOR, BinarySensorDeviceClass,
DEVICE_CLASS_LOCK,
DEVICE_CLASS_POWER,
DEVICE_CLASS_PROBLEM,
BinarySensorEntity, BinarySensorEntity,
BinarySensorEntityDescription, BinarySensorEntityDescription,
) )
@ -35,27 +32,27 @@ BINARY_SENSOR_TYPES: tuple[StarlineBinarySensorEntityDescription, ...] = (
StarlineBinarySensorEntityDescription( StarlineBinarySensorEntityDescription(
key="hbrake", key="hbrake",
name_="Hand Brake", name_="Hand Brake",
device_class=DEVICE_CLASS_POWER, device_class=BinarySensorDeviceClass.POWER,
), ),
StarlineBinarySensorEntityDescription( StarlineBinarySensorEntityDescription(
key="hood", key="hood",
name_="Hood", name_="Hood",
device_class=DEVICE_CLASS_DOOR, device_class=BinarySensorDeviceClass.DOOR,
), ),
StarlineBinarySensorEntityDescription( StarlineBinarySensorEntityDescription(
key="trunk", key="trunk",
name_="Trunk", name_="Trunk",
device_class=DEVICE_CLASS_DOOR, device_class=BinarySensorDeviceClass.DOOR,
), ),
StarlineBinarySensorEntityDescription( StarlineBinarySensorEntityDescription(
key="alarm", key="alarm",
name_="Alarm", name_="Alarm",
device_class=DEVICE_CLASS_PROBLEM, device_class=BinarySensorDeviceClass.PROBLEM,
), ),
StarlineBinarySensorEntityDescription( StarlineBinarySensorEntityDescription(
key="door", key="door",
name_="Doors", name_="Doors",
device_class=DEVICE_CLASS_LOCK, device_class=BinarySensorDeviceClass.LOCK,
), ),
) )

View file

@ -4,7 +4,7 @@ from __future__ import annotations
from dataclasses import dataclass from dataclasses import dataclass
from homeassistant.components.sensor import ( from homeassistant.components.sensor import (
DEVICE_CLASS_TEMPERATURE, SensorDeviceClass,
SensorEntity, SensorEntity,
SensorEntityDescription, SensorEntityDescription,
) )
@ -50,13 +50,13 @@ SENSOR_TYPES: tuple[StarlineSensorEntityDescription, ...] = (
StarlineSensorEntityDescription( StarlineSensorEntityDescription(
key="ctemp", key="ctemp",
name_="Interior Temperature", name_="Interior Temperature",
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
native_unit_of_measurement=TEMP_CELSIUS, native_unit_of_measurement=TEMP_CELSIUS,
), ),
StarlineSensorEntityDescription( StarlineSensorEntityDescription(
key="etemp", key="etemp",
name_="Engine Temperature", name_="Engine Temperature",
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
native_unit_of_measurement=TEMP_CELSIUS, native_unit_of_measurement=TEMP_CELSIUS,
), ),
StarlineSensorEntityDescription( StarlineSensorEntityDescription(