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 consistancepull/5035/merge
parent
41ef6228be
commit
a65388e778
|
@ -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."""
|
||||
|
|
Loading…
Reference in New Issue