Remove last_reset attribute from and set state class to total_increasing for enphase_envoy energy sensors (#54831)

This commit is contained in:
Erik Montnemery 2021-08-18 17:58:32 +02:00 committed by GitHub
parent 041ba2ec3a
commit bce7c73925
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,10 +3,10 @@
from homeassistant.components.sensor import (
STATE_CLASS_MEASUREMENT,
STATE_CLASS_TOTAL_INCREASING,
SensorEntityDescription,
)
from homeassistant.const import DEVICE_CLASS_ENERGY, ENERGY_WATT_HOUR, POWER_WATT
from homeassistant.util import dt
DOMAIN = "enphase_envoy"
@ -41,9 +41,8 @@ SENSORS = (
key="lifetime_production",
name="Lifetime Energy Production",
native_unit_of_measurement=ENERGY_WATT_HOUR,
state_class=STATE_CLASS_MEASUREMENT,
state_class=STATE_CLASS_TOTAL_INCREASING,
device_class=DEVICE_CLASS_ENERGY,
last_reset=dt.utc_from_timestamp(0),
),
SensorEntityDescription(
key="consumption",
@ -69,9 +68,8 @@ SENSORS = (
key="lifetime_consumption",
name="Lifetime Energy Consumption",
native_unit_of_measurement=ENERGY_WATT_HOUR,
state_class=STATE_CLASS_MEASUREMENT,
state_class=STATE_CLASS_TOTAL_INCREASING,
device_class=DEVICE_CLASS_ENERGY,
last_reset=dt.utc_from_timestamp(0),
),
SensorEntityDescription(
key="inverters",