Add last_reset for Sense trend sensors (#63490)
This commit is contained in:
parent
9c11b0aa89
commit
fe17f97543
5 changed files with 10 additions and 4 deletions
|
@ -1,4 +1,5 @@
|
|||
"""Support for monitoring a Sense energy sensor."""
|
||||
|
||||
from homeassistant.components.sensor import (
|
||||
SensorDeviceClass,
|
||||
SensorEntity,
|
||||
|
@ -297,6 +298,11 @@ class SenseTrendsSensor(CoordinatorEntity, SensorEntity):
|
|||
"""Return the state of the sensor."""
|
||||
return round(self._data.get_trend(self._sensor_type, self._variant_id), 1)
|
||||
|
||||
@property
|
||||
def last_reset(self):
|
||||
"""Return the time when the sensor was last reset, if any."""
|
||||
return self._data.trend_start(self._sensor_type)
|
||||
|
||||
|
||||
class SenseEnergyDevice(SensorEntity):
|
||||
"""Implementation of a Sense energy device."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue