From 616c091a4e4993fa3239ba27010f7c3c4b5f183c Mon Sep 17 00:00:00 2001 From: amittein Date: Mon, 3 Jun 2024 21:17:22 +0000 Subject: [PATCH] Backward compatibility with pre 2024.6 builds --- custom_components/retry/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/custom_components/retry/__init__.py b/custom_components/retry/__init__.py index e87e228..f0b46ca 100644 --- a/custom_components/retry/__init__.py +++ b/custom_components/retry/__init__.py @@ -449,7 +449,8 @@ def _wrap_service_calls( ) -> None: """Warp any service call with retry.""" for action in sequence: - match cv.determine_script_action(action): + action_type = cv.determine_script_action(action) + match action_type: case cv.SCRIPT_ACTION_CALL_SERVICE: if action[ATTR_SERVICE] == f"{DOMAIN}.{ACTIONS_SERVICE}": raise IntegrationError("Nested retry.actions are disallowed") @@ -483,8 +484,9 @@ def _wrap_service_calls( case cv.SCRIPT_ACTION_PARALLEL: for parallel in action[CONF_PARALLEL]: _wrap_service_calls(hass, parallel[CONF_SEQUENCE], retry_params) - case cv.SCRIPT_ACTION_SEQUENCE: - _wrap_service_calls(hass, action[CONF_SEQUENCE], retry_params) + case _: + if action_type == getattr(cv, "SCRIPT_ACTION_SEQUENCE", "sequence"): + _wrap_service_calls(hass, action[CONF_SEQUENCE], retry_params) async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool: