diff --git a/custom_components/spook/util.py b/custom_components/spook/util.py index a3ebc777..df92b365 100644 --- a/custom_components/spook/util.py +++ b/custom_components/spook/util.py @@ -256,7 +256,11 @@ def async_find_services_in_sequence( # noqa: C901 for step in sequence: action = cv.determine_script_action(step) - if action == cv.SCRIPT_ACTION_CALL_SERVICE and step.get(CONF_ENABLED, True): + if ( + action == cv.SCRIPT_ACTION_CALL_SERVICE + and CONF_SERVICE in step + and step.get(CONF_ENABLED, True) + ): called_services.add(step[CONF_SERVICE]) if action == cv.SCRIPT_ACTION_CHOOSE: