Fixed bugs to allow HA to boot again

1) helpers/event should not import the sun component unless it is
requested. This prevents circular import.
2) fixed import typo in bootstrap
2) bootstrap cannot import event_decorators until it is needed because
this leads to a circular import.
This commit is contained in:
Ryan Kraus 2016-01-24 15:55:47 -05:00
parent 0f937cad74
commit 02e634c6a2
2 changed files with 3 additions and 2 deletions

View file

@ -7,7 +7,6 @@ import functools as ft
from ..util import dt as dt_util
from ..const import (
ATTR_NOW, EVENT_STATE_CHANGED, EVENT_TIME_CHANGED, MATCH_ALL)
from homeassistant.components import sun
def track_state_change(hass, entity_ids, action, from_state=None,
@ -101,6 +100,7 @@ def track_sunrise(hass, action, offset=None):
"""
Adds a listener that will fire a specified offset from sunrise daily.
"""
from homeassistant.components import sun
offset = offset or timedelta()
def next_rise():
@ -124,6 +124,7 @@ def track_sunset(hass, action, offset=None):
"""
Adds a listener that will fire a specified offset from sunset daily.
"""
from homeassistant.components import sun
offset = offset or timedelta()
def next_set():