Skip to content

Commit

Permalink
fix: warn about potential configuration errors (could also mean entit…
Browse files Browse the repository at this point in the history
…y is still initialising after reboot)
  • Loading branch information
danobot authored Jan 4, 2021
1 parent 9f20fb5 commit 7545d2e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions custom_components/entity_controller/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ async def async_setup(hass, config):
dest="blocked",
conditions=["is_state_entities_on"],
)
machine.add_transition(trigger="enable", source="idle", dest=None, conditions=["is_state_entities_off"])

# Blocked
machine.add_transition(trigger="enable", source="blocked", dest="idle", conditions=["is_state_entities_off"])
Expand Down Expand Up @@ -708,7 +709,7 @@ def _override_entity_state(self):
state = s.state
except AttributeError as ex:
self.log.error(
"Configuration error! Override Entity ({}) does not exist. Please check for spelling and typos. {}".format(
"Potential configuration error: Override Entity ({}) does not exist (yet). Please check for spelling and typos. {}".format(
e, ex
)
)
Expand Down Expand Up @@ -738,7 +739,7 @@ def _sensor_entity_state(self):
state = s.state
except AttributeError as ex:
self.log.error(
"Configuration error! Sensor Entity ({}) does not exist. Please check for spelling and typos. {}".format(
"Potential configuration error: Sensor Entity ({}) does not exist (yet). Please check for spelling and typos. {}".format(
e, ex
)
)
Expand All @@ -764,7 +765,7 @@ def _state_entity_state(self):
state = s.state
except AttributeError as ex:
self.log.error(
"Configuration error! State Entity ({}) does not exist. Please check for spelling and typos. {}".format(
"Potential configuration error: State Entity ({}) does not exist (yet). Please check for spelling and typos. {}".format(
e, ex
)
)
Expand Down Expand Up @@ -1182,7 +1183,7 @@ def start_time_callback(self, evt):
)

self.update(start_time=parsed_start)

if self.is_state_entities_on():
self.blocked()
else:
Expand Down

0 comments on commit 7545d2e

Please sign in to comment.