Use enums in oasa_telematics (#62077)

This commit is contained in:
Robert Hillis 2021-12-16 09:34:42 -05:00 committed by GitHub
parent 0ce985ee7b
commit 6d9787526b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,8 +6,12 @@ from operator import itemgetter
import oasatelematics
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import ATTR_ATTRIBUTION, CONF_NAME, DEVICE_CLASS_TIMESTAMP
from homeassistant.components.sensor import (
PLATFORM_SCHEMA,
SensorDeviceClass,
SensorEntity,
)
from homeassistant.const import ATTR_ATTRIBUTION, CONF_NAME
import homeassistant.helpers.config_validation as cv
from homeassistant.util import dt as dt_util
@ -70,7 +74,7 @@ class OASATelematicsSensor(SensorEntity):
@property
def device_class(self):
"""Return the class of this sensor."""
return DEVICE_CLASS_TIMESTAMP
return SensorDeviceClass.TIMESTAMP
@property
def native_value(self):