mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Remove last_reset
attribute from and set state class to total_increasing
for enphase_envoy energy sensors (#54831)
This commit is contained in:
parent
041ba2ec3a
commit
bce7c73925
@ -3,10 +3,10 @@
|
|||||||
|
|
||||||
from homeassistant.components.sensor import (
|
from homeassistant.components.sensor import (
|
||||||
STATE_CLASS_MEASUREMENT,
|
STATE_CLASS_MEASUREMENT,
|
||||||
|
STATE_CLASS_TOTAL_INCREASING,
|
||||||
SensorEntityDescription,
|
SensorEntityDescription,
|
||||||
)
|
)
|
||||||
from homeassistant.const import DEVICE_CLASS_ENERGY, ENERGY_WATT_HOUR, POWER_WATT
|
from homeassistant.const import DEVICE_CLASS_ENERGY, ENERGY_WATT_HOUR, POWER_WATT
|
||||||
from homeassistant.util import dt
|
|
||||||
|
|
||||||
DOMAIN = "enphase_envoy"
|
DOMAIN = "enphase_envoy"
|
||||||
|
|
||||||
@ -41,9 +41,8 @@ SENSORS = (
|
|||||||
key="lifetime_production",
|
key="lifetime_production",
|
||||||
name="Lifetime Energy Production",
|
name="Lifetime Energy Production",
|
||||||
native_unit_of_measurement=ENERGY_WATT_HOUR,
|
native_unit_of_measurement=ENERGY_WATT_HOUR,
|
||||||
state_class=STATE_CLASS_MEASUREMENT,
|
state_class=STATE_CLASS_TOTAL_INCREASING,
|
||||||
device_class=DEVICE_CLASS_ENERGY,
|
device_class=DEVICE_CLASS_ENERGY,
|
||||||
last_reset=dt.utc_from_timestamp(0),
|
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="consumption",
|
key="consumption",
|
||||||
@ -69,9 +68,8 @@ SENSORS = (
|
|||||||
key="lifetime_consumption",
|
key="lifetime_consumption",
|
||||||
name="Lifetime Energy Consumption",
|
name="Lifetime Energy Consumption",
|
||||||
native_unit_of_measurement=ENERGY_WATT_HOUR,
|
native_unit_of_measurement=ENERGY_WATT_HOUR,
|
||||||
state_class=STATE_CLASS_MEASUREMENT,
|
state_class=STATE_CLASS_TOTAL_INCREASING,
|
||||||
device_class=DEVICE_CLASS_ENERGY,
|
device_class=DEVICE_CLASS_ENERGY,
|
||||||
last_reset=dt.utc_from_timestamp(0),
|
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="inverters",
|
key="inverters",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user