Change energy state class to STATE_CLASS_TOTAL (#56974)
This commit is contained in:
parent
e69a1c3546
commit
9d84d41f81
2 changed files with 7 additions and 7 deletions
|
@ -9,7 +9,7 @@ from iotawattpy.sensor import Sensor
|
|||
|
||||
from homeassistant.components.sensor import (
|
||||
STATE_CLASS_MEASUREMENT,
|
||||
STATE_CLASS_TOTAL_INCREASING,
|
||||
STATE_CLASS_TOTAL,
|
||||
SensorEntity,
|
||||
SensorEntityDescription,
|
||||
)
|
||||
|
@ -83,6 +83,7 @@ ENTITY_DESCRIPTION_KEY_MAP: dict[str, IotaWattSensorEntityDescription] = {
|
|||
"WattHours": IotaWattSensorEntityDescription(
|
||||
"WattHours",
|
||||
native_unit_of_measurement=ENERGY_WATT_HOUR,
|
||||
state_class=STATE_CLASS_TOTAL,
|
||||
device_class=DEVICE_CLASS_ENERGY,
|
||||
),
|
||||
"VA": IotaWattSensorEntityDescription(
|
||||
|
@ -242,7 +243,6 @@ class IotaWattAccumulatingSensor(IotaWattSensor, RestoreEntity):
|
|||
|
||||
super().__init__(coordinator, key, entity_description)
|
||||
|
||||
self._attr_state_class = STATE_CLASS_TOTAL_INCREASING
|
||||
if self._attr_unique_id is not None:
|
||||
self._attr_unique_id += ".accumulated"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue