Not used to pylint and flake8 ...
This commit is contained in:
parent
e3dcb45879
commit
8360ab265c
1 changed files with 3 additions and 4 deletions
|
@ -33,7 +33,7 @@ def register(hass, config, action):
|
||||||
CONF_BELOW, CONF_ABOVE)
|
CONF_BELOW, CONF_ABOVE)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def numeric_in_range(value, range_start, range_end):
|
def _in_range(value, range_start, range_end):
|
||||||
""" Checks if value is inside the range
|
""" Checks if value is inside the range
|
||||||
:param value:
|
:param value:
|
||||||
:param range_start:
|
:param range_start:
|
||||||
|
@ -58,9 +58,8 @@ def register(hass, config, action):
|
||||||
""" Listens for state changes and calls action. """
|
""" Listens for state changes and calls action. """
|
||||||
|
|
||||||
# Fire action if we go from outside range into range
|
# Fire action if we go from outside range into range
|
||||||
if numeric_in_range(to_s.state, above, below) and \
|
if _in_range(to_s.state, above, below) and \
|
||||||
(from_s is None or \
|
(from_s is None or not _in_range(from_s.state, above, below)):
|
||||||
not numeric_in_range(from_s.state, above, below)):
|
|
||||||
action()
|
action()
|
||||||
|
|
||||||
track_state_change(
|
track_state_change(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue