def setup(self, config):
        self.config = config

        # Look in config for Domain, Domain 2, Domain 3 etc and load them
        for p_type, p_config in config_per_platform(config, self.domain):
            self._setup_platform(p_type, p_config)

        if self.discovery_platforms:
            discovery.listen(
                self.hass, self.discovery_platforms.keys(),
                lambda service, info:
                self._setup_platform(self.discovery_platforms[service], {},
                                     info))
Set up a full entity component.
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/helpers/entity_component.py/EntityComponent.setup