mirror of
https://github.com/home-assistant/core.git
synced 2025-07-11 07:17:12 +00:00
Remove last_reset from vicare sensor (#63879)
This commit is contained in:
parent
ccc4423c62
commit
f4e9187d01
@ -30,7 +30,6 @@ from homeassistant.const import (
|
|||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
import homeassistant.util.dt as dt_util
|
|
||||||
|
|
||||||
from . import ViCareRequiredKeysMixin
|
from . import ViCareRequiredKeysMixin
|
||||||
from .const import (
|
from .const import (
|
||||||
@ -425,7 +424,6 @@ class ViCareSensor(SensorEntity):
|
|||||||
self._api = api
|
self._api = api
|
||||||
self._device_config = device_config
|
self._device_config = device_config
|
||||||
self._state = None
|
self._state = None
|
||||||
self._last_reset = dt_util.utcnow()
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_info(self):
|
def device_info(self):
|
||||||
@ -457,14 +455,8 @@ class ViCareSensor(SensorEntity):
|
|||||||
"""Return the state of the sensor."""
|
"""Return the state of the sensor."""
|
||||||
return self._state
|
return self._state
|
||||||
|
|
||||||
@property
|
|
||||||
def last_reset(self):
|
|
||||||
"""Return the time when the sensor was last reset."""
|
|
||||||
return self._last_reset
|
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
"""Update state of sensor."""
|
"""Update state of sensor."""
|
||||||
self._last_reset = dt_util.start_of_local_day()
|
|
||||||
try:
|
try:
|
||||||
with suppress(PyViCareNotSupportedFeatureError):
|
with suppress(PyViCareNotSupportedFeatureError):
|
||||||
self._state = self.entity_description.value_getter(self._api)
|
self._state = self.entity_description.value_getter(self._api)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user