mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 04:07:08 +00:00
Use new SensorStateClass enum in amberelectric (#61265)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
e4e0dcbae0
commit
549b72e48e
@ -15,9 +15,9 @@ from amberelectric.model.current_interval import CurrentInterval
|
||||
from amberelectric.model.forecast_interval import ForecastInterval
|
||||
|
||||
from homeassistant.components.sensor import (
|
||||
STATE_CLASS_MEASUREMENT,
|
||||
SensorEntity,
|
||||
SensorEntityDescription,
|
||||
SensorStateClass,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import CURRENCY_DOLLAR, ENERGY_KILO_WATT_HOUR
|
||||
@ -209,7 +209,7 @@ async def async_setup_entry(
|
||||
key="current",
|
||||
name=f"{entry.title} - {friendly_channel_type(channel_type)} Price",
|
||||
native_unit_of_measurement=UNIT,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
icon=ICONS[channel_type],
|
||||
)
|
||||
entities.append(AmberPriceSensor(coordinator, description, channel_type))
|
||||
@ -219,7 +219,7 @@ async def async_setup_entry(
|
||||
key="forecasts",
|
||||
name=f"{entry.title} - {friendly_channel_type(channel_type)} Forecast",
|
||||
native_unit_of_measurement=UNIT,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
icon=ICONS[channel_type],
|
||||
)
|
||||
entities.append(AmberForecastSensor(coordinator, description, channel_type))
|
||||
@ -228,7 +228,7 @@ async def async_setup_entry(
|
||||
key="renewables",
|
||||
name=f"{entry.title} - Renewables",
|
||||
native_unit_of_measurement="%",
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
icon="mdi:solar-power",
|
||||
)
|
||||
entities.append(AmberGridSensor(coordinator, renewables_description))
|
||||
|
Loading…
x
Reference in New Issue
Block a user