Add improvements of device_automation from frontend PR 3514 ()

* Add improvements from frontend PR 3514

* Fix test

* Tweak
pull/26347/head
Erik Montnemery 2019-09-02 06:40:18 +02:00 committed by Paulus Schoutsen
parent 79488daddf
commit 3aa2729716
4 changed files with 11 additions and 2 deletions
homeassistant/components
automation
device_automation
tests/components/device_automation

View File

@ -4,6 +4,7 @@
"documentation": "https://www.home-assistant.io/components/automation",
"requirements": [],
"dependencies": [
"device_automation",
"group",
"webhook"
],

View File

@ -75,7 +75,7 @@ async def async_get_device_automation_triggers(hass, device_id):
@websocket_api.async_response
@websocket_api.websocket_command(
{
vol.Required("type"): "device_automation/list_triggers",
vol.Required("type"): "device_automation/trigger/list",
vol.Required("device_id"): str,
}
)

View File

@ -0,0 +1,8 @@
{
"device_automation": {
"trigger_type": {
"turn_on": "{name} turned on",
"turn_off": "{name} turned off"
}
}
}

View File

@ -62,7 +62,7 @@ async def test_websocket_get_triggers(hass, hass_ws_client, device_reg, entity_r
await client.send_json(
{
"id": 1,
"type": "device_automation/list_triggers",
"type": "device_automation/trigger/list",
"device_id": device_entry.id,
}
)