mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 14:57:09 +00:00
Add state class to Eliqonline (#52111)
This commit is contained in:
parent
7f7c0febd8
commit
38daf94562
@ -6,7 +6,11 @@ import logging
|
|||||||
import eliqonline
|
import eliqonline
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
|
from homeassistant.components.sensor import (
|
||||||
|
PLATFORM_SCHEMA,
|
||||||
|
STATE_CLASS_MEASUREMENT,
|
||||||
|
SensorEntity,
|
||||||
|
)
|
||||||
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
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
@ -54,6 +58,8 @@ 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
|
||||||
|
|
||||||
def __init__(self, api, channel_id, name):
|
def __init__(self, api, channel_id, name):
|
||||||
"""Initialize the sensor."""
|
"""Initialize the sensor."""
|
||||||
self._name = name
|
self._name = name
|
||||||
|
Loading…
x
Reference in New Issue
Block a user