Use enums in rdw (#62059)
This commit is contained in:
parent
079b7f217f
commit
5227019d3e
2 changed files with 5 additions and 5 deletions
|
@ -7,7 +7,7 @@ from dataclasses import dataclass
|
||||||
from vehicle import Vehicle
|
from vehicle import Vehicle
|
||||||
|
|
||||||
from homeassistant.components.binary_sensor import (
|
from homeassistant.components.binary_sensor import (
|
||||||
DEVICE_CLASS_PROBLEM,
|
BinarySensorDeviceClass,
|
||||||
BinarySensorEntity,
|
BinarySensorEntity,
|
||||||
BinarySensorEntityDescription,
|
BinarySensorEntityDescription,
|
||||||
)
|
)
|
||||||
|
@ -48,7 +48,7 @@ BINARY_SENSORS: tuple[RDWBinarySensorEntityDescription, ...] = (
|
||||||
RDWBinarySensorEntityDescription(
|
RDWBinarySensorEntityDescription(
|
||||||
key="pending_recall",
|
key="pending_recall",
|
||||||
name="Pending Recall",
|
name="Pending Recall",
|
||||||
device_class=DEVICE_CLASS_PROBLEM,
|
device_class=BinarySensorDeviceClass.PROBLEM,
|
||||||
is_on_fn=lambda vehicle: vehicle.pending_recall,
|
is_on_fn=lambda vehicle: vehicle.pending_recall,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
@ -8,7 +8,7 @@ from datetime import date
|
||||||
from vehicle import Vehicle
|
from vehicle import Vehicle
|
||||||
|
|
||||||
from homeassistant.components.sensor import (
|
from homeassistant.components.sensor import (
|
||||||
DEVICE_CLASS_DATE,
|
SensorDeviceClass,
|
||||||
SensorEntity,
|
SensorEntity,
|
||||||
SensorEntityDescription,
|
SensorEntityDescription,
|
||||||
)
|
)
|
||||||
|
@ -43,13 +43,13 @@ SENSORS: tuple[RDWSensorEntityDescription, ...] = (
|
||||||
RDWSensorEntityDescription(
|
RDWSensorEntityDescription(
|
||||||
key="apk_expiration",
|
key="apk_expiration",
|
||||||
name="APK Expiration",
|
name="APK Expiration",
|
||||||
device_class=DEVICE_CLASS_DATE,
|
device_class=SensorDeviceClass.DATE,
|
||||||
value_fn=lambda vehicle: vehicle.apk_expiration,
|
value_fn=lambda vehicle: vehicle.apk_expiration,
|
||||||
),
|
),
|
||||||
RDWSensorEntityDescription(
|
RDWSensorEntityDescription(
|
||||||
key="ascription_date",
|
key="ascription_date",
|
||||||
name="Ascription Date",
|
name="Ascription Date",
|
||||||
device_class=DEVICE_CLASS_DATE,
|
device_class=SensorDeviceClass.DATE,
|
||||||
value_fn=lambda vehicle: vehicle.ascription_date,
|
value_fn=lambda vehicle: vehicle.ascription_date,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue