Skip to content

Commit cdec5d7

Browse files
committed
feat: Add total increasing state class to last meter reading sensor
1 parent ef69323 commit cdec5d7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

custom_components/monta/sensor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
SensorDeviceClass,
1414
SensorEntity,
1515
SensorEntityDescription,
16+
SensorStateClass,
1617
)
1718
from homeassistant.config_entries import ConfigEntry
1819
from homeassistant.const import (
@@ -30,7 +31,6 @@
3031
ATTRIBUTION,
3132
DOMAIN,
3233
ChargerStatus,
33-
WalletStatus,
3434
)
3535
from .coordinator import MontaDataUpdateCoordinator
3636
from .entity import MontaEntity
@@ -152,6 +152,7 @@ def _parse_date(chargedate: str):
152152
icon="mdi:wallet",
153153
device_class=SensorDeviceClass.ENERGY,
154154
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
155+
state_class=SensorStateClass.TOTAL_INCREASING,
155156
value_fn=lambda data: data["lastMeterReadingKwh"],
156157
extra_state_attributes_fn=None,
157158
),

0 commit comments

Comments
 (0)