Use new SensorDeviceClass enum in hvv_departures (#61780)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2021-12-14 11:55:31 +01:00 committed by GitHub
parent f4edd0ea20
commit 96e54ca939
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -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):

View file

@ -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):