Minor cleanup core
This commit is contained in:
parent
e0468f8b8e
commit
7870e9a5e2
7 changed files with 55 additions and 73 deletions
|
@ -135,22 +135,6 @@ class EntityComponent(object):
|
|||
self.hass, platform_config, self.add_entities, discovery_info)
|
||||
|
||||
self.hass.config.components.append(platform_name)
|
||||
|
||||
except AttributeError:
|
||||
# AttributeError if setup_platform does not exist
|
||||
# Support old deprecated method for now - 3/1/2015
|
||||
if hasattr(platform, 'get_devices'):
|
||||
self.logger.warning(
|
||||
'Please upgrade %s to return new entities using '
|
||||
'setup_platform. See %s/demo.py for an example.',
|
||||
platform_name, self.domain)
|
||||
self.add_entities(
|
||||
platform.get_devices(self.hass, platform_config))
|
||||
|
||||
else:
|
||||
self.logger.exception(
|
||||
'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…
Add table
Add a link
Reference in a new issue