mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 09:47:13 +00:00
Use enums in obihai (#62078)
This commit is contained in:
parent
dab1a786a5
commit
06f670272f
@ -5,13 +5,12 @@ import logging
|
|||||||
from pyobihai import PyObihai
|
from pyobihai import PyObihai
|
||||||
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 (
|
PLATFORM_SCHEMA,
|
||||||
CONF_HOST,
|
SensorDeviceClass,
|
||||||
CONF_PASSWORD,
|
SensorEntity,
|
||||||
CONF_USERNAME,
|
|
||||||
DEVICE_CLASS_TIMESTAMP,
|
|
||||||
)
|
)
|
||||||
|
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
@ -105,7 +104,7 @@ class ObihaiServiceSensors(SensorEntity):
|
|||||||
def device_class(self):
|
def device_class(self):
|
||||||
"""Return the device class for uptime sensor."""
|
"""Return the device class for uptime sensor."""
|
||||||
if self._service_name == "Last Reboot":
|
if self._service_name == "Last Reboot":
|
||||||
return DEVICE_CLASS_TIMESTAMP
|
return SensorDeviceClass.TIMESTAMP
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user