Remove last_reset attribute from FritzBoxEnergySensor (#54644)
This commit is contained in:
parent
41c3bd113c
commit
0abcfb42b3
2 changed files with 4 additions and 13 deletions
|
@ -1,13 +1,12 @@
|
|||
"""Support for AVM FRITZ!SmartHome temperature sensor only devices."""
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
from pyfritzhome import FritzhomeDevice
|
||||
|
||||
from homeassistant.components.sensor import (
|
||||
ATTR_STATE_CLASS,
|
||||
STATE_CLASS_MEASUREMENT,
|
||||
STATE_CLASS_TOTAL_INCREASING,
|
||||
SensorEntity,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
|
@ -28,7 +27,6 @@ from homeassistant.const import (
|
|||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
||||
from homeassistant.util.dt import utc_from_timestamp
|
||||
|
||||
from . import FritzBoxEntity
|
||||
from .const import (
|
||||
|
@ -99,7 +97,7 @@ async def async_setup_entry(
|
|||
ATTR_ENTITY_ID: f"{device.ain}_total_energy",
|
||||
ATTR_UNIT_OF_MEASUREMENT: ENERGY_KILO_WATT_HOUR,
|
||||
ATTR_DEVICE_CLASS: DEVICE_CLASS_ENERGY,
|
||||
ATTR_STATE_CLASS: STATE_CLASS_MEASUREMENT,
|
||||
ATTR_STATE_CLASS: STATE_CLASS_TOTAL_INCREASING,
|
||||
},
|
||||
coordinator,
|
||||
ain,
|
||||
|
@ -153,12 +151,6 @@ class FritzBoxEnergySensor(FritzBoxSensor):
|
|||
return energy / 1000 # type: ignore [no-any-return]
|
||||
return 0.0
|
||||
|
||||
@property
|
||||
def last_reset(self) -> datetime:
|
||||
"""Return the time when the sensor was last reset, if any."""
|
||||
# device does not provide timestamp of initialization
|
||||
return utc_from_timestamp(0)
|
||||
|
||||
|
||||
class FritzBoxTempSensor(FritzBoxSensor):
|
||||
"""The entity class for FRITZ!SmartHome temperature sensors."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue