Use enums in yandex_transport (#61978)
parent
806366a0c1
commit
173582d4fc
|
@ -6,8 +6,12 @@ import logging
|
||||||
from aioymaps import CaptchaError, YandexMapsRequester
|
from aioymaps import CaptchaError, YandexMapsRequester
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
|
from homeassistant.components.sensor import (
|
||||||
from homeassistant.const import ATTR_ATTRIBUTION, CONF_NAME, DEVICE_CLASS_TIMESTAMP
|
PLATFORM_SCHEMA,
|
||||||
|
SensorDeviceClass,
|
||||||
|
SensorEntity,
|
||||||
|
)
|
||||||
|
from homeassistant.const import ATTR_ATTRIBUTION, CONF_NAME
|
||||||
from homeassistant.helpers.aiohttp_client import async_create_clientsession
|
from homeassistant.helpers.aiohttp_client import async_create_clientsession
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
import homeassistant.util.dt as dt_util
|
import homeassistant.util.dt as dt_util
|
||||||
|
@ -140,7 +144,7 @@ class DiscoverYandexTransport(SensorEntity):
|
||||||
@property
|
@property
|
||||||
def device_class(self):
|
def device_class(self):
|
||||||
"""Return the device class."""
|
"""Return the device class."""
|
||||||
return DEVICE_CLASS_TIMESTAMP
|
return SensorDeviceClass.TIMESTAMP
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
|
|
Loading…
Reference in New Issue