Fixed after param

This commit is contained in:
Stefan Jonasson 2015-09-16 22:46:21 +02:00
parent 3c3eadbef5
commit 9b96471182

View file

@ -22,6 +22,10 @@ WEEKDAYS = ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun']
def trigger(hass, config, action):
""" Listen for state changes based on `config`. """
hours = convert(config.get(CONF_HOURS), int)
minutes = convert(config.get(CONF_MINUTES), int)
seconds = convert(config.get(CONF_SECONDS), int)
if CONF_AFTER in config:
after = dt_util.parse_time_str(config[CONF_AFTER])
if after is None:
@ -30,10 +34,6 @@ def trigger(hass, config, action):
return False
hours, minutes, seconds = after.hour, after.minute, after.second
hours = convert(config.get(CONF_HOURS), int)
minutes = convert(config.get(CONF_MINUTES), int)
seconds = convert(config.get(CONF_SECONDS), int)
def time_automation_listener(now):
""" Listens for time changes and calls action. """
action()