diff --git a/homeassistant/components/file/__init__.py b/homeassistant/components/file/__init__.py index 82e12ee5d165c3..0ed5aa0f7b41a8 100644 --- a/homeassistant/components/file/__init__.py +++ b/homeassistant/components/file/__init__.py @@ -45,7 +45,10 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: ) # Import the YAML config into separate config entries - for domain, items in config.items(): + platforms_config = { + domain: config[domain] for domain in YAML_PLATFORMS if domain in config + } + for domain, items in platforms_config.items(): for item in items: if item[CONF_PLATFORM] == DOMAIN: item[CONF_PLATFORM] = domain