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])