Add device automation condition (#26313)
* Add support for device conditions * Lint * Update test case * Make and+or conditions async, adjust tests * Cleanup tests * Remove non callback versions of conditions, correct typing * Correct typing * Update light/strings.json * Address review comments * Make device automation lists simple lists, not dicts * Add device_automation/const.py * Use IS_ON/IS_OFF everywhere for conditions
This commit is contained in:
parent
c50faaef3c
commit
f7dc537275
11 changed files with 480 additions and 263 deletions
|
@ -338,7 +338,7 @@ class Script:
|
|||
config_cache_key = frozenset((k, str(v)) for k, v in action.items())
|
||||
config = self._config_cache.get(config_cache_key)
|
||||
if not config:
|
||||
config = condition.async_from_config(action, False)
|
||||
config = await condition.async_from_config(self.hass, action, False)
|
||||
self._config_cache[config_cache_key] = config
|
||||
|
||||
self.last_action = action.get(CONF_ALIAS, action[CONF_CONDITION])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue