1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Fix not condition validation and entity/device extraction (#34959)

This commit is contained in:
Franck Nijhof
2020-05-01 00:15:53 +02:00
committed by GitHub
parent 6fe00497d6
commit 928d9ec117
2 changed files with 98 additions and 5 deletions

View File

@@ -536,7 +536,7 @@ async def async_validate_condition_config(
) -> ConfigType:
"""Validate config."""
condition = config[CONF_CONDITION]
if condition in ("and", "or"):
if condition in ("and", "not", "or"):
conditions = []
for sub_cond in config["conditions"]:
sub_cond = await async_validate_condition_config(hass, sub_cond)
@@ -563,7 +563,7 @@ def async_extract_entities(config: ConfigType) -> Set[str]:
config = to_process.popleft()
condition = config[CONF_CONDITION]
if condition in ("and", "or"):
if condition in ("and", "not", "or"):
to_process.extend(config["conditions"])
continue
@@ -585,7 +585,7 @@ def async_extract_devices(config: ConfigType) -> Set[str]:
config = to_process.popleft()
condition = config[CONF_CONDITION]
if condition in ("and", "or"):
if condition in ("and", "not", "or"):
to_process.extend(config["conditions"])
continue