From a4e0a7f2353c6c55f803969c055d3789e9ea62b9 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 14 May 2015 21:36:12 -0700 Subject: [PATCH] Fix platform discovery not working --- homeassistant/bootstrap.py | 1 - homeassistant/helpers/entity_component.py | 10 +++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/homeassistant/bootstrap.py b/homeassistant/bootstrap.py index e674e6e3ab6..787e0f80562 100644 --- a/homeassistant/bootstrap.py +++ b/homeassistant/bootstrap.py @@ -107,7 +107,6 @@ def prepare_setup_platform(hass, config, domain, platform_name): # Not found if platform is None: - _LOGGER.error('Unable to find platform %s', platform_path) return None # Already loaded or no dependencies diff --git a/homeassistant/helpers/entity_component.py b/homeassistant/helpers/entity_component.py index 6a0a2527e21..381584fabb8 100644 --- a/homeassistant/helpers/entity_component.py +++ b/homeassistant/helpers/entity_component.py @@ -35,17 +35,21 @@ class EntityComponent(object): self.group = None self.is_polling = False + self.config = None + def setup(self, config): """ Sets up a full entity component: - Loads the platforms from the config - Will listen for supported discovered platforms """ + 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.logger): - self._setup_platform(config, p_type, p_config) + self._setup_platform(p_type, p_config) if self.discovery_platforms: discovery.listen(self.hass, self.discovery_platforms.keys(), @@ -115,11 +119,11 @@ class EntityComponent(object): self._update_entity_states, second=range(0, 60, self.scan_interval)) - def _setup_platform(self, config, platform_type, platform_config, + def _setup_platform(self, platform_type, platform_config, discovery_info=None): """ Tries to setup a platform for this component. """ platform = prepare_setup_platform( - self.hass, config, self.domain, platform_type) + self.hass, self.config, self.domain, platform_type) if platform is None: return