Raise ConditionError for state errors (#46244)
This commit is contained in:
parent
6a62ebb6a4
commit
f27066e773
3 changed files with 53 additions and 5 deletions
|
@ -356,7 +356,12 @@ class BayesianBinarySensor(BinarySensorEntity):
|
|||
"""Return True if state conditions are met."""
|
||||
entity = entity_observation["entity_id"]
|
||||
|
||||
return condition.state(self.hass, entity, entity_observation.get("to_state"))
|
||||
try:
|
||||
return condition.state(
|
||||
self.hass, entity, entity_observation.get("to_state")
|
||||
)
|
||||
except ConditionError:
|
||||
return False
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue