mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Simplify if statement
This commit is contained in:
parent
ff8f22854c
commit
2606e4d641
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user