Skip to content

Commit ee1a871

Browse files
committed
add function entity_ids that returns all entities
1 parent a1ad5a4 commit ee1a871

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

custom_components/pyscript/handler.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def init(hass):
3434
"task.unique": Handler.task_unique,
3535
"service.call": Handler.service_call,
3636
"service.has_service": Handler.service_has_service,
37+
"entity_ids": Handler.entity_ids,
3738
}
3839

3940
#
@@ -57,6 +58,9 @@ def init(hass):
5758
#
5859
Handler.loggers = {}
5960

61+
async def entity_ids(domain=None):
62+
return Handler.hass.states.async_entity_ids(domain)
63+
6064
async def async_sleep(duration):
6165
"""Implement task.sleep()."""
6266
await asyncio.sleep(float(duration))

0 commit comments

Comments
 (0)