diff --git a/homeassistant/components/rdw/binary_sensor.py b/homeassistant/components/rdw/binary_sensor.py index 80f4a425212..81d3e448b78 100644 --- a/homeassistant/components/rdw/binary_sensor.py +++ b/homeassistant/components/rdw/binary_sensor.py @@ -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, ), ) diff --git a/homeassistant/components/rdw/sensor.py b/homeassistant/components/rdw/sensor.py index f2c8d93a8a2..04f525c61b8 100644 --- a/homeassistant/components/rdw/sensor.py +++ b/homeassistant/components/rdw/sensor.py @@ -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, ), )