Keep track of top level components (#115586)

* Keep track of top level components

Currently we have to do a set comp for icons, translations,
and integration platforms every time to split the top level
components from the platforms. Keep track of the top level
components in a seperate set so avoid having to do the setcomp
every time.

* remove impossible paths

* remove unused code

* preen

* preen

* fix

* coverage and fixes

* Update homeassistant/core.py

* Update homeassistant/core.py

* Update tests/test_core.py
This commit is contained in:
J. Nick Koston 2024-04-17 06:23:20 -05:00 committed by GitHub
parent fee1f2833d
commit cb16465539
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 83 additions and 45 deletions

View file

@ -106,8 +106,8 @@ async def test_get_icons(hass: HomeAssistant) -> None:
# Ensure icons file for platform isn't loaded, as that isn't supported
icons = await icon.async_get_icons(hass, "entity")
assert icons == {}
icons = await icon.async_get_icons(hass, "entity", ["test.switch"])
assert icons == {}
with pytest.raises(ValueError, match="test.switch"):
await icon.async_get_icons(hass, "entity", ["test.switch"])
# Load up an custom integration
hass.config.components.add("test_package")