mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 05:47:10 +00:00
Use enums in rova (#62044)
This commit is contained in:
parent
093202f138
commit
fa522fc504
@ -10,14 +10,11 @@ import voluptuous as vol
|
|||||||
|
|
||||||
from homeassistant.components.sensor import (
|
from homeassistant.components.sensor import (
|
||||||
PLATFORM_SCHEMA,
|
PLATFORM_SCHEMA,
|
||||||
|
SensorDeviceClass,
|
||||||
SensorEntity,
|
SensorEntity,
|
||||||
SensorEntityDescription,
|
SensorEntityDescription,
|
||||||
)
|
)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import CONF_MONITORED_CONDITIONS, CONF_NAME
|
||||||
CONF_MONITORED_CONDITIONS,
|
|
||||||
CONF_NAME,
|
|
||||||
DEVICE_CLASS_TIMESTAMP,
|
|
||||||
)
|
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.util import Throttle
|
from homeassistant.util import Throttle
|
||||||
from homeassistant.util.dt import get_time_zone, now
|
from homeassistant.util.dt import get_time_zone, now
|
||||||
@ -110,7 +107,7 @@ class RovaSensor(SensorEntity):
|
|||||||
self.data_service = data_service
|
self.data_service = data_service
|
||||||
|
|
||||||
self._attr_name = f"{platform_name}_{description.name}"
|
self._attr_name = f"{platform_name}_{description.name}"
|
||||||
self._attr_device_class = DEVICE_CLASS_TIMESTAMP
|
self._attr_device_class = SensorDeviceClass.TIMESTAMP
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
"""Get the latest data from the sensor and update the state."""
|
"""Get the latest data from the sensor and update the state."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user