Fix Bayesian ConfigFlow templates in 2025.10 (#153289)

Co-authored-by: Erik Montnemery <erik@montnemery.com>
This commit is contained in:
HarvsG
2025-10-01 10:39:23 +01:00
committed by GitHub
parent 08b6a0a702
commit 06d143b81a
2 changed files with 47 additions and 1 deletions

View File

@@ -272,6 +272,13 @@ async def async_setup_entry(
observations: list[ConfigType] = [
dict(subentry.data) for subentry in config_entry.subentries.values()
]
for observation in observations:
if observation[CONF_PLATFORM] == CONF_TEMPLATE:
observation[CONF_VALUE_TEMPLATE] = Template(
observation[CONF_VALUE_TEMPLATE], hass
)
prior: float = config[CONF_PRIOR]
probability_threshold: float = config[CONF_PROBABILITY_THRESHOLD]
device_class: BinarySensorDeviceClass | None = config.get(CONF_DEVICE_CLASS)