mirror of
https://github.com/home-assistant/core.git
synced 2025-07-12 15:57:06 +00:00
Use new SensorStateClass in eliqonline (#61380)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
5559c751a9
commit
b5cd13a134
@ -8,8 +8,8 @@ import voluptuous as vol
|
|||||||
|
|
||||||
from homeassistant.components.sensor import (
|
from homeassistant.components.sensor import (
|
||||||
PLATFORM_SCHEMA,
|
PLATFORM_SCHEMA,
|
||||||
STATE_CLASS_MEASUREMENT,
|
|
||||||
SensorEntity,
|
SensorEntity,
|
||||||
|
SensorStateClass,
|
||||||
)
|
)
|
||||||
from homeassistant.const import CONF_ACCESS_TOKEN, CONF_NAME, POWER_WATT
|
from homeassistant.const import CONF_ACCESS_TOKEN, CONF_NAME, POWER_WATT
|
||||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||||
@ -58,7 +58,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
|||||||
class EliqSensor(SensorEntity):
|
class EliqSensor(SensorEntity):
|
||||||
"""Implementation of an ELIQ Online sensor."""
|
"""Implementation of an ELIQ Online sensor."""
|
||||||
|
|
||||||
_attr_state_class = STATE_CLASS_MEASUREMENT
|
_attr_state_class = SensorStateClass.MEASUREMENT
|
||||||
|
|
||||||
def __init__(self, api, channel_id, name):
|
def __init__(self, api, channel_id, name):
|
||||||
"""Initialize the sensor."""
|
"""Initialize the sensor."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user