diff --git a/custom_components/hass_stadtreinigung_hamburg/sensor.py b/custom_components/hass_stadtreinigung_hamburg/sensor.py index 86d8cc4..be47c6f 100644 --- a/custom_components/hass_stadtreinigung_hamburg/sensor.py +++ b/custom_components/hass_stadtreinigung_hamburg/sensor.py @@ -1,13 +1,12 @@ import voluptuous as vol -from homeassistant.components.sensor import PLATFORM_SCHEMA +from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorDeviceClass import homeassistant.helpers.config_validation as cv from homeassistant.util import Throttle, slugify from homeassistant.config_entries import ConfigEntry -from homeassistant.const import CONF_NAME, DEVICE_CLASS_TIMESTAMP +from homeassistant.const import CONF_NAME from homeassistant.helpers.entity import Entity import logging -from datetime import datetime -from datetime import timedelta +from datetime import datetime, timedelta from homeassistant.core import HomeAssistant from typing import Optional @@ -99,7 +98,7 @@ def unit_of_measurement(self): @property def device_class(self) -> Optional[str]: """Return the class of this device, from component DEVICE_CLASSES.""" - return DEVICE_CLASS_TIMESTAMP + return SensorDeviceClass.TIMESTAMP @property def extra_state_attributes(self):