From 38daf94562c06379ddf59173a9136827a57daf7d Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 23 Jun 2021 19:44:55 +0200 Subject: [PATCH] Add state class to Eliqonline (#52111) --- homeassistant/components/eliqonline/sensor.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/eliqonline/sensor.py b/homeassistant/components/eliqonline/sensor.py index a4d812850f7..253913b3779 100644 --- a/homeassistant/components/eliqonline/sensor.py +++ b/homeassistant/components/eliqonline/sensor.py @@ -6,7 +6,11 @@ import logging import eliqonline 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.helpers.aiohttp_client import async_get_clientsession 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): """Implementation of an ELIQ Online sensor.""" + _attr_state_class = STATE_CLASS_MEASUREMENT + def __init__(self, api, channel_id, name): """Initialize the sensor.""" self._name = name