We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents de5ed80 + 993bbf1 commit a22cd5dCopy full SHA for a22cd5d
custom_components/monta/sensor.py
@@ -15,6 +15,9 @@
15
SensorEntityDescription,
16
)
17
from homeassistant.config_entries import ConfigEntry
18
+from homeassistant.const import (
19
+ UnitOfEnergy,
20
+)
21
from homeassistant.core import HomeAssistant
22
from homeassistant.helpers.entity import generate_entity_id
23
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@@ -143,6 +146,8 @@ def _parse_date(chargedate: str):
143
146
key="charger_lastMeterReadingKwh",
144
147
name="Last meter reading",
145
148
icon="mdi:wallet",
149
+ device_class=SensorDeviceClass.ENERGY,
150
+ native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
151
value_fn=lambda data: data["lastMeterReadingKwh"],
152
extra_state_attributes_fn=None,
153
),
0 commit comments