mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Use enums in rdw (#62059)
This commit is contained in:
parent
079b7f217f
commit
5227019d3e
@ -7,7 +7,7 @@ from dataclasses import dataclass
|
||||
from vehicle import Vehicle
|
||||
|
||||
from homeassistant.components.binary_sensor import (
|
||||
DEVICE_CLASS_PROBLEM,
|
||||
BinarySensorDeviceClass,
|
||||
BinarySensorEntity,
|
||||
BinarySensorEntityDescription,
|
||||
)
|
||||
@ -48,7 +48,7 @@ BINARY_SENSORS: tuple[RDWBinarySensorEntityDescription, ...] = (
|
||||
RDWBinarySensorEntityDescription(
|
||||
key="pending_recall",
|
||||
name="Pending Recall",
|
||||
device_class=DEVICE_CLASS_PROBLEM,
|
||||
device_class=BinarySensorDeviceClass.PROBLEM,
|
||||
is_on_fn=lambda vehicle: vehicle.pending_recall,
|
||||
),
|
||||
)
|
||||
|
@ -8,7 +8,7 @@ from datetime import date
|
||||
from vehicle import Vehicle
|
||||
|
||||
from homeassistant.components.sensor import (
|
||||
DEVICE_CLASS_DATE,
|
||||
SensorDeviceClass,
|
||||
SensorEntity,
|
||||
SensorEntityDescription,
|
||||
)
|
||||
@ -43,13 +43,13 @@ SENSORS: tuple[RDWSensorEntityDescription, ...] = (
|
||||
RDWSensorEntityDescription(
|
||||
key="apk_expiration",
|
||||
name="APK Expiration",
|
||||
device_class=DEVICE_CLASS_DATE,
|
||||
device_class=SensorDeviceClass.DATE,
|
||||
value_fn=lambda vehicle: vehicle.apk_expiration,
|
||||
),
|
||||
RDWSensorEntityDescription(
|
||||
key="ascription_date",
|
||||
name="Ascription Date",
|
||||
device_class=DEVICE_CLASS_DATE,
|
||||
device_class=SensorDeviceClass.DATE,
|
||||
value_fn=lambda vehicle: vehicle.ascription_date,
|
||||
),
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user