mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 14:17:45 +00:00
Tweaks to EntityComponent.setup_platform
This commit is contained in:
parent
cdd5d1196a
commit
49d7901585
@ -127,7 +127,11 @@ class EntityComponent(object):
|
|||||||
try:
|
try:
|
||||||
platform.setup_platform(
|
platform.setup_platform(
|
||||||
self.hass, config, self.add_entities, discovery_info)
|
self.hass, config, self.add_entities, discovery_info)
|
||||||
|
|
||||||
|
self.hass.config.components.append(platform_name)
|
||||||
|
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
|
# AttributeError if setup_platform does not exist
|
||||||
# Support old deprecated method for now - 3/1/2015
|
# Support old deprecated method for now - 3/1/2015
|
||||||
if hasattr(platform, 'get_devices'):
|
if hasattr(platform, 'get_devices'):
|
||||||
self.logger.warning(
|
self.logger.warning(
|
||||||
@ -137,6 +141,9 @@ class EntityComponent(object):
|
|||||||
self.add_entities(platform.get_devices(self.hass, config))
|
self.add_entities(platform.get_devices(self.hass, config))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# AttributeError if setup_platform does not exist
|
|
||||||
self.logger.exception(
|
self.logger.exception(
|
||||||
"Error setting up %s", platform_type)
|
"Error while setting up platform %s", platform_type)
|
||||||
|
|
||||||
|
except Exception: # pylint: disable=broad-except
|
||||||
|
self.logger.exception(
|
||||||
|
"Error while setting up platform %s", platform_type)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user