mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Add shorthand notation for Template conditions (#39705)
This commit is contained in:
@@ -935,7 +935,10 @@ class Script:
|
||||
await asyncio.shield(self._async_stop(update_state))
|
||||
|
||||
async def _async_get_condition(self, config):
|
||||
config_cache_key = frozenset((k, str(v)) for k, v in config.items())
|
||||
if isinstance(config, template.Template):
|
||||
config_cache_key = config.template
|
||||
else:
|
||||
config_cache_key = frozenset((k, str(v)) for k, v in config.items())
|
||||
cond = self._config_cache.get(config_cache_key)
|
||||
if not cond:
|
||||
cond = await condition.async_from_config(self._hass, config, False)
|
||||
|
||||
Reference in New Issue
Block a user