Add support for for to binary_sensor, light and switch device triggers (#26658)

* Add support for `for` to binary_sensor, light and switch device triggers

* Add WS API device_automation/trigger/capabilities
This commit is contained in:
Erik Montnemery authored and GitHub committed 2019-10-02 22:14:52 +02:00
1 parent d8c6b281b8
commit 65ce3b49c1
21 files changed
+495 -42

No files matched your search

@@ -22,7 +22,6 @@ async def async_attach_trigger(
automation_info: dict,
) -> CALLBACK_TYPE:
"""Listen for state changes based on configuration."""
config = TRIGGER_SCHEMA(config)
return await toggle_entity.async_attach_trigger(
hass, config, action, automation_info
)
@@ -31,3 +30,8 @@ async def async_attach_trigger(
async def async_get_triggers(hass: HomeAssistant, device_id: str) -> List[dict]:
"""List device triggers."""
return await toggle_entity.async_get_triggers(hass, device_id, DOMAIN)
async def async_get_trigger_capabilities(hass: HomeAssistant, trigger: dict) -> dict:
"""List trigger capabilities."""
return await toggle_entity.async_get_trigger_capabilities(hass, trigger)