mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
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
This commit is contained in:
parent
41ef6228be
commit
a65388e778
@ -135,6 +135,8 @@ track_point_in_utc_time = threaded_listener_factory(
|
|||||||
|
|
||||||
def async_track_time_interval(hass, action, interval):
|
def async_track_time_interval(hass, action, interval):
|
||||||
"""Add a listener that fires repetitively at every timedelta interval."""
|
"""Add a listener that fires repetitively at every timedelta interval."""
|
||||||
|
remove = None
|
||||||
|
|
||||||
def next_interval():
|
def next_interval():
|
||||||
"""Return the next interval."""
|
"""Return the next interval."""
|
||||||
return dt_util.utcnow() + 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."""
|
"""Add a listener that will fire a specified offset from sunrise daily."""
|
||||||
from homeassistant.components import sun
|
from homeassistant.components import sun
|
||||||
offset = offset or timedelta()
|
offset = offset or timedelta()
|
||||||
|
remove = None
|
||||||
|
|
||||||
def next_rise():
|
def next_rise():
|
||||||
"""Return the next sunrise."""
|
"""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."""
|
"""Add a listener that will fire a specified offset from sunset daily."""
|
||||||
from homeassistant.components import sun
|
from homeassistant.components import sun
|
||||||
offset = offset or timedelta()
|
offset = offset or timedelta()
|
||||||
|
remove = None
|
||||||
|
|
||||||
def next_set():
|
def next_set():
|
||||||
"""Return next sunrise."""
|
"""Return next sunrise."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user