Adjust state class of solarlog yield and consumption sensors (#56824)
parent
735c9f8f0b
commit
ab037383ed
|
@ -5,7 +5,7 @@ from dataclasses import dataclass
|
|||
|
||||
from homeassistant.components.sensor import (
|
||||
STATE_CLASS_MEASUREMENT,
|
||||
STATE_CLASS_TOTAL_INCREASING,
|
||||
STATE_CLASS_TOTAL,
|
||||
SensorEntityDescription,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
|
@ -19,7 +19,6 @@ from homeassistant.const import (
|
|||
PERCENTAGE,
|
||||
POWER_WATT,
|
||||
)
|
||||
from homeassistant.util import dt
|
||||
|
||||
DOMAIN = "solarlog"
|
||||
|
||||
|
@ -102,7 +101,7 @@ SENSOR_TYPES: tuple[SolarLogSensorEntityDescription, ...] = (
|
|||
name="yield total",
|
||||
icon="mdi:solar-power",
|
||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
||||
state_class=STATE_CLASS_TOTAL_INCREASING,
|
||||
state_class=STATE_CLASS_TOTAL,
|
||||
factor=0.001,
|
||||
),
|
||||
SolarLogSensorEntityDescription(
|
||||
|
@ -145,8 +144,7 @@ SENSOR_TYPES: tuple[SolarLogSensorEntityDescription, ...] = (
|
|||
name="consumption total",
|
||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
||||
device_class=DEVICE_CLASS_ENERGY,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
last_reset=dt.utc_from_timestamp(0),
|
||||
state_class=STATE_CLASS_TOTAL,
|
||||
factor=0.001,
|
||||
),
|
||||
SolarLogSensorEntityDescription(
|
||||
|
|
Loading…
Reference in New Issue