From a65388e778b4110d9d54f418caf9b6580840c85e Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Sun, 8 Jan 2017 14:06:15 +0100 Subject: [PATCH] Bugfix segfault with new helper track_time_interval (#5222) * Bugfix sigfault with new helper track_time_interval * Add none init also to sunrise/sunset for consistance --- homeassistant/helpers/event.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/homeassistant/helpers/event.py b/homeassistant/helpers/event.py index 29d3d131f5c..802a1dc1a7d 100644 --- a/homeassistant/helpers/event.py +++ b/homeassistant/helpers/event.py @@ -135,6 +135,8 @@ track_point_in_utc_time = threaded_listener_factory( def async_track_time_interval(hass, action, interval): """Add a listener that fires repetitively at every timedelta interval.""" + remove = None + def next_interval(): """Return the next interval.""" return dt_util.utcnow() + interval @@ -164,6 +166,7 @@ def async_track_sunrise(hass, action, offset=None): """Add a listener that will fire a specified offset from sunrise daily.""" from homeassistant.components import sun offset = offset or timedelta() + remove = None def next_rise(): """Return the next sunrise.""" @@ -199,6 +202,7 @@ def async_track_sunset(hass, action, offset=None): """Add a listener that will fire a specified offset from sunset daily.""" from homeassistant.components import sun offset = offset or timedelta() + remove = None def next_set(): """Return next sunrise."""