From 3e235f6e70333524208799c5a4052a38743230f3 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Wed, 18 Aug 2021 13:36:35 +0200 Subject: [PATCH] Remove `last_reset` attribute and set state class to `total_increasing` for Ovo cost and energy sensors (#54807) --- homeassistant/components/ovo_energy/sensor.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/ovo_energy/sensor.py b/homeassistant/components/ovo_energy/sensor.py index 91290238dce..e1130ca36a5 100644 --- a/homeassistant/components/ovo_energy/sensor.py +++ b/homeassistant/components/ovo_energy/sensor.py @@ -6,12 +6,11 @@ from datetime import timedelta from ovoenergy import OVODailyUsage from ovoenergy.ovoenergy import OVOEnergy -from homeassistant.components.sensor import SensorEntity +from homeassistant.components.sensor import STATE_CLASS_TOTAL_INCREASING, SensorEntity from homeassistant.config_entries import ConfigEntry from homeassistant.const import DEVICE_CLASS_ENERGY, DEVICE_CLASS_MONETARY from homeassistant.core import HomeAssistant from homeassistant.helpers.update_coordinator import DataUpdateCoordinator -from homeassistant.util.dt import utc_from_timestamp from . import OVOEnergyDeviceEntity from .const import DATA_CLIENT, DATA_COORDINATOR, DOMAIN @@ -61,8 +60,7 @@ async def async_setup_entry( class OVOEnergySensor(OVOEnergyDeviceEntity, SensorEntity): """Defines a OVO Energy sensor.""" - _attr_last_reset = utc_from_timestamp(0) - _attr_state_class = "measurement" + _attr_state_class = STATE_CLASS_TOTAL_INCREASING def __init__( self,