mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +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
|
return None
|
||||||
|
|
||||||
# Make sure configuration keys have the right value
|
# Make sure configuration keys have the right value
|
||||||
if before is not None and before not in (EVENT_SUNRISE, EVENT_SUNSET) or \
|
if before not in (None, EVENT_SUNRISE, EVENT_SUNSET) or \
|
||||||
after is not None and after not in (EVENT_SUNRISE, EVENT_SUNSET):
|
after not in (None, EVENT_SUNRISE, EVENT_SUNSET):
|
||||||
logging.getLogger(__name__).error(
|
logging.getLogger(__name__).error(
|
||||||
"%s and %s can only be set to %s or %s",
|
"%s and %s can only be set to %s or %s",
|
||||||
CONF_BEFORE, CONF_AFTER, EVENT_SUNRISE, EVENT_SUNSET)
|
CONF_BEFORE, CONF_AFTER, EVENT_SUNRISE, EVENT_SUNSET)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user