From 96e54ca9391ac55e99c3370fa48060c2b09a5ee4 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 14 Dec 2021 11:55:31 +0100 Subject: [PATCH] Use new SensorDeviceClass enum in hvv_departures (#61780) Co-authored-by: epenet --- homeassistant/components/hvv_departures/binary_sensor.py | 4 ++-- homeassistant/components/hvv_departures/sensor.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/hvv_departures/binary_sensor.py b/homeassistant/components/hvv_departures/binary_sensor.py index a3494a2b6d8..19792cb8e39 100644 --- a/homeassistant/components/hvv_departures/binary_sensor.py +++ b/homeassistant/components/hvv_departures/binary_sensor.py @@ -7,7 +7,7 @@ import async_timeout from pygti.exceptions import InvalidAuth from homeassistant.components.binary_sensor import ( - DEVICE_CLASS_PROBLEM, + BinarySensorDeviceClass, BinarySensorEntity, ) from homeassistant.const import ATTR_ATTRIBUTION @@ -172,7 +172,7 @@ class HvvDepartureBinarySensor(CoordinatorEntity, BinarySensorEntity): @property def device_class(self): """Return the class of this device, from component DEVICE_CLASSES.""" - return DEVICE_CLASS_PROBLEM + return BinarySensorDeviceClass.PROBLEM @property def extra_state_attributes(self): diff --git a/homeassistant/components/hvv_departures/sensor.py b/homeassistant/components/hvv_departures/sensor.py index d82a15cebe9..507c0601803 100644 --- a/homeassistant/components/hvv_departures/sensor.py +++ b/homeassistant/components/hvv_departures/sensor.py @@ -5,8 +5,8 @@ import logging from aiohttp import ClientConnectorError from pygti.exceptions import InvalidAuth -from homeassistant.components.sensor import SensorEntity -from homeassistant.const import ATTR_ATTRIBUTION, ATTR_ID, DEVICE_CLASS_TIMESTAMP +from homeassistant.components.sensor import SensorDeviceClass, SensorEntity +from homeassistant.const import ATTR_ATTRIBUTION, ATTR_ID from homeassistant.helpers import aiohttp_client from homeassistant.helpers.entity import DeviceInfo from homeassistant.util import Throttle @@ -195,7 +195,7 @@ class HVVDepartureSensor(SensorEntity): @property def device_class(self): """Return the class of this device, from component DEVICE_CLASSES.""" - return DEVICE_CLASS_TIMESTAMP + return SensorDeviceClass.TIMESTAMP @property def extra_state_attributes(self):