Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasloven committed Aug 7, 2019
1 parent 52189e9 commit 56033ed
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions homeassistant/components/websocket_api/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,14 @@ def handle_render_template(hass, connection, msg):

entity_ids = msg.get("entity_ids")
if entity_ids is None:
entity_ids = list(set(template.extract_entities(variables)))
entity_ids = template.extract_entities(variables)
if entity_ids == MATCH_ALL:
connection.send_error(
msg["id"],
const.ERR_UNAUTHORIZED,
"Updating on all state changes not allowed",
)
return

@callback
def state_listener(*_):
Expand All @@ -241,5 +248,5 @@ def state_listener(*_):
hass, entity_ids, state_listener
)

connection.send_message(messages.result_message(msg["id"]))
connection.send_result(msg["id"])
state_listener()

0 comments on commit 56033ed

Please sign in to comment.