Add websocket trigger/condition commands (#39109)

This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2020-08-24 23:01:57 +02:00
1 parent d5193e64de
commit 2a1fe9d29a
10 files changed
+204 -61

No files matched your search

+12 -13
View File
@@ -57,19 +57,18 @@ async def async_attach_trigger(hass, config, action, automation_info):
and not to_match
):
hass.async_run_job(
action(
{
"trigger": {
"platform": "zone",
"entity_id": entity,
"from_state": from_s,
"to_state": to_s,
"zone": zone_state,
"event": event,
}
},
context=to_s.context,
)
action,
{
"trigger": {
"platform": "zone",
"entity_id": entity,
"from_state": from_s,
"to_state": to_s,
"zone": zone_state,
"event": event,
}
},
to_s.context,
)
return async_track_state_change_event(hass, entity_id, zone_automation_listener)