mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Fix all entities triggering all observations in bayesian sensor (#28979)
* change fromkeys to dict comprehension to prevent append working on a list by reference. Now each entity id has its own seperate list * change fromkeys to dict comprehension to prevent append working on a list by reference. Now each entity id has its own seperate list * use get instead of direct keys for dict * change fromkeys to dict comprehension to prevent append working on a list by reference. Now each entity id has its own seperate list * use get instead of direct keys for dict * changed get back to []
This commit is contained in:
parent
a37260faa9
commit
078a7e446d
@ -133,7 +133,7 @@ class BayesianBinarySensor(BinarySensorDevice):
|
||||
to_observe.update(set([obs.get("entity_id")]))
|
||||
if "value_template" in obs:
|
||||
to_observe.update(set(obs.get(CONF_VALUE_TEMPLATE).extract_entities()))
|
||||
self.entity_obs = dict.fromkeys(to_observe, [])
|
||||
self.entity_obs = {key: [] for key in to_observe}
|
||||
|
||||
for ind, obs in enumerate(self._observations):
|
||||
obs["id"] = ind
|
||||
|
Loading…
x
Reference in New Issue
Block a user