diff --git a/homeassistant/components/home_connect/api.py b/homeassistant/components/home_connect/api.py index cf14de7cc42..380688ba6ff 100644 --- a/homeassistant/components/home_connect/api.py +++ b/homeassistant/components/home_connect/api.py @@ -7,12 +7,12 @@ import homeconnect from homeconnect.api import HomeConnectError from homeassistant import config_entries, core +from homeassistant.components.sensor import SensorDeviceClass from homeassistant.const import ( ATTR_DEVICE_CLASS, ATTR_ICON, CONF_DEVICE, CONF_ENTITIES, - DEVICE_CLASS_TIMESTAMP, PERCENTAGE, TIME_SECONDS, ) @@ -159,7 +159,7 @@ class DeviceWithPrograms(HomeConnectDevice): device. """ sensors = { - "Remaining Program Time": (None, None, DEVICE_CLASS_TIMESTAMP, 1), + "Remaining Program Time": (None, None, SensorDeviceClass.TIMESTAMP, 1), "Duration": (TIME_SECONDS, "mdi:update", None, 1), "Program Progress": (PERCENTAGE, "mdi:progress-clock", None, 1), } diff --git a/homeassistant/components/home_connect/sensor.py b/homeassistant/components/home_connect/sensor.py index 910bec3e6ab..8c68113a055 100644 --- a/homeassistant/components/home_connect/sensor.py +++ b/homeassistant/components/home_connect/sensor.py @@ -3,8 +3,8 @@ from datetime import timedelta import logging -from homeassistant.components.sensor import SensorEntity -from homeassistant.const import CONF_ENTITIES, DEVICE_CLASS_TIMESTAMP +from homeassistant.components.sensor import SensorDeviceClass, SensorEntity +from homeassistant.const import CONF_ENTITIES import homeassistant.util.dt as dt_util from .const import ATTR_VALUE, BSH_OPERATION_STATE, DOMAIN @@ -57,7 +57,7 @@ class HomeConnectSensor(HomeConnectEntity, SensorEntity): if self._key not in status: self._state = None else: - if self.device_class == DEVICE_CLASS_TIMESTAMP: + if self.device_class == SensorDeviceClass.TIMESTAMP: if ATTR_VALUE not in status[self._key]: self._state = None elif (