Set state class to total for Integration sensors (#55872)

This commit is contained in:
Erik Montnemery 2021-09-07 00:27:31 +02:00 committed by GitHub
parent 6895081595
commit b1dbdec2ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 7 deletions

View file

@ -8,7 +8,7 @@ from homeassistant.components.sensor import (
DEVICE_CLASS_ENERGY,
DEVICE_CLASS_POWER,
PLATFORM_SCHEMA,
STATE_CLASS_TOTAL_INCREASING,
STATE_CLASS_TOTAL,
SensorEntity,
)
from homeassistant.const import (
@ -116,7 +116,7 @@ class IntegrationSensor(RestoreEntity, SensorEntity):
self._unit_of_measurement = unit_of_measurement
self._unit_prefix = UNIT_PREFIXES[unit_prefix]
self._unit_time = UNIT_TIME[unit_time]
self._attr_state_class = STATE_CLASS_TOTAL_INCREASING
self._attr_state_class = STATE_CLASS_TOTAL
async def async_added_to_hass(self):
"""Handle entity which will be added."""