From 443c2caa0cf5e7a63aa48a6776a8bded9f7ffb73 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 29 Oct 2026 18:39:14 -1000 Subject: [PATCH] [output] Name the channel key in the duplicate-channel error --- esphome/components/output/__init__.py | 2 +- tests/component_tests/output/test_output.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/output/__init__.py b/esphome/components/output/__init__.py index 7b173ef7e40..d9c1a284d6f 100644 --- a/esphome/components/output/__init__.py +++ b/esphome/components/output/__init__.py @@ -142,7 +142,7 @@ def final_validate_unique_channel( domain=DOMAIN, platform=platform, keys=(hub_key, channel_key), - message="Channel '{1}' of '{0}' is already used by another output", + message=f"{channel_key.capitalize()} '{{1}}' of '{{0}}' is already used by another output", ) diff --git a/tests/component_tests/output/test_output.py b/tests/component_tests/output/test_output.py index fc474d3d71b..e93a0e02a02 100644 --- a/tests/component_tests/output/test_output.py +++ b/tests/component_tests/output/test_output.py @@ -107,5 +107,5 @@ def test_hub_channel_key_can_be_renamed(set_core_config: SetCoreConfigCallable) full["output"] = entries set_core_config(PlatformFramework.ESP32_IDF, full_config=full) validate(entries[1]) - with pytest.raises(cv.Invalid, match="Channel '3' of 'a' is already used"): + with pytest.raises(cv.Invalid, match="Pin '3' of 'a' is already used"): validate(entries[2])