diff --git a/esphome/config_helpers.py b/esphome/config_helpers.py index 8bee3b3a52..c82c2b3dbe 100644 --- a/esphome/config_helpers.py +++ b/esphome/config_helpers.py @@ -105,6 +105,9 @@ def frameworks_for_platforms(platforms: Collection[str]) -> set[PlatformFramewor registry: deriving the framework set here means a platform added to the registry cannot validate and then fail at link on a filtered-out file. """ + known = {pf.value[0].value for pf in PlatformFramework} + if unknown := set(platforms) - known: + raise ValueError(f"unknown platform(s): {sorted(unknown)}") return {pf for pf in PlatformFramework if pf.value[0].value in platforms} diff --git a/tests/component_tests/bluetooth_proxy/test_platform_gates.py b/tests/component_tests/bluetooth_proxy/test_platform_gates.py index 8e1e413ad0..a47dfd53fa 100644 --- a/tests/component_tests/bluetooth_proxy/test_platform_gates.py +++ b/tests/component_tests/bluetooth_proxy/test_platform_gates.py @@ -189,7 +189,7 @@ def test_hub_source_filter_covers_every_hub_platform() -> None: hub_frameworks = bluetooth_connection.SOURCE_FILE_FRAMEWORKS[ "bluetooth_connection_hub.cpp" ] - assert expected <= hub_frameworks + assert expected == hub_frameworks def test_bluetooth_connection_auto_load_covers_its_includes() -> None: