mirror of
https://github.com/home-assistant/core.git
synced 2025-11-10 11:29:46 +00:00
Add missing conext preservation to bayesian and universal (#40178)
We already do this for template sensors, but it was missing for bayesian and universal
This commit is contained in:
@@ -182,6 +182,7 @@ class BayesianBinarySensor(BinarySensorEntity):
|
||||
entity = event.data.get("entity_id")
|
||||
|
||||
self.current_observations.update(self._record_entity_observations(entity))
|
||||
self.async_set_context(event.context)
|
||||
self._recalculate_and_write_state()
|
||||
|
||||
self.async_on_remove(
|
||||
@@ -220,6 +221,8 @@ class BayesianBinarySensor(BinarySensorEntity):
|
||||
obs_entry = None
|
||||
self.current_observations[obs["id"]] = obs_entry
|
||||
|
||||
if event:
|
||||
self.async_set_context(event.context)
|
||||
self._recalculate_and_write_state()
|
||||
|
||||
for template in self.observations_by_template:
|
||||
|
||||
Reference in New Issue
Block a user