From 3e187d6c171ea1a7db59c2eedc050e661e1f4125 Mon Sep 17 00:00:00 2001 From: sergioisidoro Date: Sat, 27 Mar 2021 10:37:29 +0200 Subject: [PATCH] Temp comment code --- custom_components/ruuvi/sensor.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/custom_components/ruuvi/sensor.py b/custom_components/ruuvi/sensor.py index 12de729..12a54b4 100644 --- a/custom_components/ruuvi/sensor.py +++ b/custom_components/ruuvi/sensor.py @@ -157,11 +157,11 @@ def set_state(self, state): _LOGGER.debug(f"Updated {self.update_time} {self.name}: {self.state}") self.schedule_update_ha_state() - call_later(self.hass, EXPIRE_AFTER, self.expire_state_if_old) - - def expire_state_if_old(self, delay): - state_age_seconds = (dt.utcnow() - self.update_time) / datetime.timedelta(seconds=1) - if state_age_seconds >= EXPIRE_AFTER: - _LOGGER.debug(f"{self.name}: Expire state due to age") - self._state = STATE_UNKNOWN - self.schedule_update_ha_state() + # call_later(self.hass, EXPIRE_AFTER, self.expire_state_if_old) + + # def expire_state_if_old(self, delay): + # state_age_seconds = (dt.utcnow() - self.update_time) / datetime.timedelta(seconds=1) + # if state_age_seconds >= EXPIRE_AFTER: + # _LOGGER.debug(f"{self.name}: Expire state due to age") + # self._state = STATE_UNKNOWN + # self.schedule_update_ha_state()