Skip to content

Commit

Permalink
Fix STATE_CLASS_MEASUREMENT
Browse files Browse the repository at this point in the history
  • Loading branch information
MiguelAngelLV committed Dec 18, 2024
1 parent 40cacec commit 350aca4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions custom_components/octopus_spain/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
)

from homeassistant.components.sensor import (
STATE_CLASS_MEASUREMENT,
SensorEntityDescription, SensorEntity
SensorEntityDescription, SensorEntity, SensorStateClass
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback
Expand Down Expand Up @@ -73,7 +72,7 @@ def __init__(self, account: str, key: str, name: str, coordinator, single: bool)
key=f"{key}_{account}",
icon="mdi:piggy-bank-outline",
native_unit_of_measurement=CURRENCY_EURO,
state_class=STATE_CLASS_MEASUREMENT
state_class=SensorStateClass.MEASUREMENT
)

async def async_added_to_hass(self) -> None:
Expand Down Expand Up @@ -104,7 +103,7 @@ def __init__(self, account: str, coordinator, single: bool):
key=f"last_invoice_{account}",
icon="mdi:currency-eur",
native_unit_of_measurement=CURRENCY_EURO,
state_class=STATE_CLASS_MEASUREMENT
state_class=SensorStateClass.MEASUREMENT
)

async def async_added_to_hass(self) -> None:
Expand Down

0 comments on commit 350aca4

Please sign in to comment.