Forward config entry only to used platforms

This commit is contained in:
Pierre Ståhl
2020-09-15 12:29:07 +02:00
parent e824f285fa
commit 9493f17de6

View File

@@ -16,7 +16,7 @@ from homeassistant.const import (
import homeassistant.helpers.config_validation as cv
from . import pytuya
from .const import CONF_LOCAL_KEY, CONF_PROTOCOL_VERSION, DOMAIN, PLATFORMS
from .const import CONF_LOCAL_KEY, CONF_PROTOCOL_VERSION, DOMAIN
DEFAULT_ID = "1"
@@ -75,7 +75,7 @@ async def async_setup(hass: HomeAssistant, config: dict):
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
"""Set up LocalTuya integration from a config entry."""
for component in PLATFORMS:
for component in set(entity[CONF_PLATFORM] for entity in entry.data[CONF_ENTITIES]):
hass.async_create_task(
hass.config_entries.async_forward_entry_setup(entry, component)
)