From 9b964711822b82e1aa4db3d4f87702582cb974e5 Mon Sep 17 00:00:00 2001 From: Stefan Jonasson Date: Wed, 16 Sep 2015 22:46:21 +0200 Subject: [PATCH] Fixed after param --- homeassistant/components/automation/time.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/automation/time.py b/homeassistant/components/automation/time.py index 821295fdffa..922b6b8287e 100644 --- a/homeassistant/components/automation/time.py +++ b/homeassistant/components/automation/time.py @@ -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()