Set state class to total for Integration sensors (#55872)
This commit is contained in:
parent
6895081595
commit
b1dbdec2ea
2 changed files with 9 additions and 7 deletions
|
@ -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."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue