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
|
@ -2,7 +2,7 @@
|
||||||
"domain": "emulated_kasa",
|
"domain": "emulated_kasa",
|
||||||
"name": "Emulated Kasa",
|
"name": "Emulated Kasa",
|
||||||
"documentation": "https://www.home-assistant.io/integrations/emulated_kasa",
|
"documentation": "https://www.home-assistant.io/integrations/emulated_kasa",
|
||||||
"requirements": ["sense_energy==0.9.3"],
|
"requirements": ["sense_energy==0.9.6"],
|
||||||
"codeowners": ["@kbickar"],
|
"codeowners": ["@kbickar"],
|
||||||
"quality_scale": "internal",
|
"quality_scale": "internal",
|
||||||
"iot_class": "local_push"
|
"iot_class": "local_push"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"domain": "sense",
|
"domain": "sense",
|
||||||
"name": "Sense",
|
"name": "Sense",
|
||||||
"documentation": "https://www.home-assistant.io/integrations/sense",
|
"documentation": "https://www.home-assistant.io/integrations/sense",
|
||||||
"requirements": ["sense_energy==0.9.3"],
|
"requirements": ["sense_energy==0.9.6"],
|
||||||
"codeowners": ["@kbickar"],
|
"codeowners": ["@kbickar"],
|
||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"dhcp": [
|
"dhcp": [
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
"""Support for monitoring a Sense energy sensor."""
|
"""Support for monitoring a Sense energy sensor."""
|
||||||
|
|
||||||
from homeassistant.components.sensor import (
|
from homeassistant.components.sensor import (
|
||||||
SensorDeviceClass,
|
SensorDeviceClass,
|
||||||
SensorEntity,
|
SensorEntity,
|
||||||
|
@ -297,6 +298,11 @@ class SenseTrendsSensor(CoordinatorEntity, SensorEntity):
|
||||||
"""Return the state of the sensor."""
|
"""Return the state of the sensor."""
|
||||||
return round(self._data.get_trend(self._sensor_type, self._variant_id), 1)
|
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):
|
class SenseEnergyDevice(SensorEntity):
|
||||||
"""Implementation of a Sense energy device."""
|
"""Implementation of a Sense energy device."""
|
||||||
|
|
|
@ -2166,7 +2166,7 @@ sense-hat==2.2.0
|
||||||
|
|
||||||
# homeassistant.components.emulated_kasa
|
# homeassistant.components.emulated_kasa
|
||||||
# homeassistant.components.sense
|
# homeassistant.components.sense
|
||||||
sense_energy==0.9.3
|
sense_energy==0.9.6
|
||||||
|
|
||||||
# homeassistant.components.sentry
|
# homeassistant.components.sentry
|
||||||
sentry-sdk==1.5.2
|
sentry-sdk==1.5.2
|
||||||
|
|
|
@ -1322,7 +1322,7 @@ screenlogicpy==0.5.4
|
||||||
|
|
||||||
# homeassistant.components.emulated_kasa
|
# homeassistant.components.emulated_kasa
|
||||||
# homeassistant.components.sense
|
# homeassistant.components.sense
|
||||||
sense_energy==0.9.3
|
sense_energy==0.9.6
|
||||||
|
|
||||||
# homeassistant.components.sentry
|
# homeassistant.components.sentry
|
||||||
sentry-sdk==1.5.2
|
sentry-sdk==1.5.2
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue