mirror of
https://github.com/home-assistant/core.git
synced 2025-06-06 14:17:06 +00:00
Update SolarEdge to use new state classes (#54731)
This commit is contained in:
parent
3bc45eacfc
commit
b981e69f95
@ -2,7 +2,10 @@
|
|||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.components.sensor import STATE_CLASS_MEASUREMENT
|
from homeassistant.components.sensor import (
|
||||||
|
STATE_CLASS_MEASUREMENT,
|
||||||
|
STATE_CLASS_TOTAL_INCREASING,
|
||||||
|
)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
DEVICE_CLASS_ENERGY,
|
DEVICE_CLASS_ENERGY,
|
||||||
DEVICE_CLASS_POWER,
|
DEVICE_CLASS_POWER,
|
||||||
@ -10,7 +13,6 @@ from homeassistant.const import (
|
|||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
POWER_WATT,
|
POWER_WATT,
|
||||||
)
|
)
|
||||||
from homeassistant.util import dt as dt_util
|
|
||||||
|
|
||||||
from .models import SolarEdgeSensorEntityDescription
|
from .models import SolarEdgeSensorEntityDescription
|
||||||
|
|
||||||
@ -40,8 +42,7 @@ SENSOR_TYPES = [
|
|||||||
json_key="lifeTimeData",
|
json_key="lifeTimeData",
|
||||||
name="Lifetime energy",
|
name="Lifetime energy",
|
||||||
icon="mdi:solar-power",
|
icon="mdi:solar-power",
|
||||||
last_reset=dt_util.utc_from_timestamp(0),
|
state_class=STATE_CLASS_TOTAL_INCREASING,
|
||||||
state_class=STATE_CLASS_MEASUREMENT,
|
|
||||||
native_unit_of_measurement=ENERGY_WATT_HOUR,
|
native_unit_of_measurement=ENERGY_WATT_HOUR,
|
||||||
device_class=DEVICE_CLASS_ENERGY,
|
device_class=DEVICE_CLASS_ENERGY,
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user