Skip to content

Commit 6cce5d5

Browse files
committed
filled in integration_entities
1 parent be5f490 commit 6cce5d5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

appdaemon/plugins/hass/hassapi.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1378,7 +1378,7 @@ async def render_template(self, template: str, namespace: str | None = None) ->
13781378
except (SyntaxError, ValueError):
13791379
return result
13801380

1381-
def _template_command(self, command: str, *args: tuple[str, ...]) -> str | list[str]:
1381+
def _template_command(self, command: str, *args: str) -> str | list[str]:
13821382
"""Internal AppDaemon function to format calling a single template command correctly."""
13831383
if len(args) == 0:
13841384
return self.render_template(f'{{{{ {command}() }}}}')
@@ -1481,6 +1481,10 @@ def integration_entities(self, integration: str) -> list[str]:
14811481
<https://www.home-assistant.io/docs/configuration/templating/#entities-for-an-integration>`_ for more
14821482
information.
14831483
"""
1484+
entities = self._template_command('integration_entities', integration)
1485+
assert isinstance(entities, list) and all(isinstance(e, str) for e in entities), \
1486+
'Invalid return type from integration_entities'
1487+
return entities
14841488

14851489
# Labels
14861490
# https://www.home-assistant.io/docs/configuration/templating/#labels

0 commit comments

Comments
 (0)