From b43acc4c30b6b3691b3562abce9ad85d6a92e02a Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Mon, 15 Aug 2022 14:37:26 +0200 Subject: [PATCH] Blog post for AutomationActionType deprecation (#1435) --- ...8-15-automation-action-type-deprecation.md | 19 +++++++++++++++++++ docs/device_automation_trigger.md | 4 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 blog/2022-08-15-automation-action-type-deprecation.md diff --git a/blog/2022-08-15-automation-action-type-deprecation.md b/blog/2022-08-15-automation-action-type-deprecation.md new file mode 100644 index 00000000..fa5d207b --- /dev/null +++ b/blog/2022-08-15-automation-action-type-deprecation.md @@ -0,0 +1,19 @@ +--- +author: Marc Mueller +authorURL: https://github.com/cdce8p +title: "AutomationActionType deprecation for 2022.9" +--- + +For Home Assistant Core 2022.9, we have deprecated `AutomationActionType`, `AutomationTriggerInfo`, +and `AutomationTriggerData` from `homeassistant/components/automation/__init__.py`. +They are being replaced by `TriggerActionType`, `TriggerInfo`, and `TriggerData` +from `homeassistant/helpers/trigger.py`. + +| Old | New | +| --- | --- | +| `AutomationActionType` | `TriggerActionType` | +| `AutomationTriggerInfo` | `TriggerInfo` | +| `AutomationTriggerData` | `TriggerData` | + +Furthermore, we recommend updating the `automation_info` parameter name for the +`async_attach_trigger` function to `trigger_info`. diff --git a/docs/device_automation_trigger.md b/docs/device_automation_trigger.md index 1e33b993..1ada928e 100644 --- a/docs/device_automation_trigger.md +++ b/docs/device_automation_trigger.md @@ -92,7 +92,7 @@ To wire it up: Given a `TRIGGER_SCHEMA` config, make sure the `action` is called For example, you might attach the trigger and action to [Events fired](integration_events.md) on the event bus by your integration. ```python -async def async_attach_trigger(hass, config, action, automation_info): +async def async_attach_trigger(hass, config, action, trigger_info): """Attach a trigger.""" event_config = event_trigger.TRIGGER_SCHEMA({ event_trigger.CONF_PLATFORM: "event", @@ -103,7 +103,7 @@ async def async_attach_trigger(hass, config, action, automation_info): }, } return await event_trigger.async_attach_trigger( - hass, event_config, action, automation_info, platform_type="device" + hass, event_config, action, trigger_info, platform_type="device" ) ```