From 2606e4d641d0f16e48fd4c2321adc6a918300e0e Mon Sep 17 00:00:00 2001 From: Philip Lundrigan Date: Thu, 24 Dec 2015 00:38:49 -0700 Subject: [PATCH] Simplify if statement --- homeassistant/components/automation/sun.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/automation/sun.py b/homeassistant/components/automation/sun.py index cf14d220fb0..a5035c8936a 100644 --- a/homeassistant/components/automation/sun.py +++ b/homeassistant/components/automation/sun.py @@ -67,8 +67,8 @@ def if_action(hass, config): return None # Make sure configuration keys have the right value - if before is not None and before not in (EVENT_SUNRISE, EVENT_SUNSET) or \ - after is not None and after not in (EVENT_SUNRISE, EVENT_SUNSET): + if before not in (None, EVENT_SUNRISE, EVENT_SUNSET) or \ + after not in (None, EVENT_SUNRISE, EVENT_SUNSET): logging.getLogger(__name__).error( "%s and %s can only be set to %s or %s", CONF_BEFORE, CONF_AFTER, EVENT_SUNRISE, EVENT_SUNSET)