Fix last_reset set for Sense percentage sensors (#110977)
This commit is contained in:
parent
ec4bd9a421
commit
70542efc23
1 changed files with 3 additions and 1 deletions
|
@ -300,7 +300,9 @@ class SenseTrendsSensor(CoordinatorEntity, SensorEntity):
|
|||
@property
|
||||
def last_reset(self):
|
||||
"""Return the time when the sensor was last reset, if any."""
|
||||
return self._data.trend_start(self._sensor_type)
|
||||
if self._attr_state_class == SensorStateClass.TOTAL:
|
||||
return self._data.trend_start(self._sensor_type)
|
||||
return None
|
||||
|
||||
|
||||
class SenseEnergyDevice(SensorEntity):
|
||||
|
|
Loading…
Add table
Reference in a new issue