From 99360ad7f43580345dc8cae7c9cc47e554bb94c4 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Tue, 3 May 2022 13:04:59 +0200 Subject: [PATCH] Indicate disabled steps in script trace (#71237) --- homeassistant/helpers/script.py | 1 + tests/helpers/test_script.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/homeassistant/helpers/script.py b/homeassistant/helpers/script.py index 0b755ae0032..54ae4f456ab 100644 --- a/homeassistant/helpers/script.py +++ b/homeassistant/helpers/script.py @@ -439,6 +439,7 @@ class _ScriptRun: self._log( "Skipped disabled step %s", self._action.get(CONF_ALIAS, action) ) + trace_set_result(enabled=False) return try: diff --git a/tests/helpers/test_script.py b/tests/helpers/test_script.py index c01f086a12a..136729e62fc 100644 --- a/tests/helpers/test_script.py +++ b/tests/helpers/test_script.py @@ -4939,8 +4939,8 @@ async def test_disabled_actions( assert_action_trace( { "0": [{"result": {"event": "test_event", "event_data": {}}}], - "1": [{}], - "2": [{}], + "1": [{"result": {"enabled": False}}], + "2": [{"result": {"enabled": False}}], "3": [{"result": {"event": "test_event", "event_data": {}}}], }, )