mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 07:37:34 +00:00
Remove last_reset
attribute and set state class to total_increasing
for Ovo cost and energy sensors (#54807)
This commit is contained in:
parent
939fde0a50
commit
3e235f6e70
@ -6,12 +6,11 @@ from datetime import timedelta
|
|||||||
from ovoenergy import OVODailyUsage
|
from ovoenergy import OVODailyUsage
|
||||||
from ovoenergy.ovoenergy import OVOEnergy
|
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.config_entries import ConfigEntry
|
||||||
from homeassistant.const import DEVICE_CLASS_ENERGY, DEVICE_CLASS_MONETARY
|
from homeassistant.const import DEVICE_CLASS_ENERGY, DEVICE_CLASS_MONETARY
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
||||||
from homeassistant.util.dt import utc_from_timestamp
|
|
||||||
|
|
||||||
from . import OVOEnergyDeviceEntity
|
from . import OVOEnergyDeviceEntity
|
||||||
from .const import DATA_CLIENT, DATA_COORDINATOR, DOMAIN
|
from .const import DATA_CLIENT, DATA_COORDINATOR, DOMAIN
|
||||||
@ -61,8 +60,7 @@ async def async_setup_entry(
|
|||||||
class OVOEnergySensor(OVOEnergyDeviceEntity, SensorEntity):
|
class OVOEnergySensor(OVOEnergyDeviceEntity, SensorEntity):
|
||||||
"""Defines a OVO Energy sensor."""
|
"""Defines a OVO Energy sensor."""
|
||||||
|
|
||||||
_attr_last_reset = utc_from_timestamp(0)
|
_attr_state_class = STATE_CLASS_TOTAL_INCREASING
|
||||||
_attr_state_class = "measurement"
|
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user