mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
Use enums in oasa_telematics (#62077)
This commit is contained in:
parent
0ce985ee7b
commit
6d9787526b
@ -6,8 +6,12 @@ from operator import itemgetter
|
|||||||
import oasatelematics
|
import oasatelematics
|
||||||
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
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.util import dt as dt_util
|
from homeassistant.util import dt as dt_util
|
||||||
|
|
||||||
@ -70,7 +74,7 @@ class OASATelematicsSensor(SensorEntity):
|
|||||||
@property
|
@property
|
||||||
def device_class(self):
|
def device_class(self):
|
||||||
"""Return the class of this sensor."""
|
"""Return the class of this sensor."""
|
||||||
return DEVICE_CLASS_TIMESTAMP
|
return SensorDeviceClass.TIMESTAMP
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def native_value(self):
|
def native_value(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user