Skip to content
Snippets Groups Projects
Commit a517784c authored by Philip Lundrigan's avatar Philip Lundrigan
Browse files

Condense in_range template logic

parent 91a945f4
No related branches found
No related tags found
No related merge requests found
......@@ -92,12 +92,7 @@ def if_action(hass, config):
def _in_range(state, range_start, range_end, renderer):
""" Checks if value is inside the range """
if renderer is not None:
value = renderer({'value': state})
else:
# If no renderer is provided, just assume they want the state
value = state.state
value = state.state if renderer is None else renderer({'value': state})
try:
value = float(value)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment