mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Discovery listener on all EntityComponents (#2042)
This commit is contained in:
parent
c341ae0a39
commit
fbe940139a
@ -63,15 +63,14 @@ class EntityComponent(object):
|
||||
self._setup_platform(self.discovery_platforms[service], {},
|
||||
info))
|
||||
|
||||
# Generic discovery listener for loading platform dynamically
|
||||
# Refer to: homeassistant.components.discovery.load_platform()
|
||||
def load_platform_callback(service, info):
|
||||
"""Callback to load a platform."""
|
||||
platform = info.pop(discovery.LOAD_PLATFORM)
|
||||
self._setup_platform(platform, {}, info if info else None)
|
||||
discovery.listen(
|
||||
self.hass, discovery.LOAD_PLATFORM + '.' + self.domain,
|
||||
load_platform_callback)
|
||||
# Generic discovery listener for loading platform dynamically
|
||||
# Refer to: homeassistant.components.discovery.load_platform()
|
||||
def load_platform_callback(service, info):
|
||||
"""Callback to load a platform."""
|
||||
platform = info.pop(discovery.LOAD_PLATFORM)
|
||||
self._setup_platform(platform, {}, info if info else None)
|
||||
discovery.listen(self.hass, discovery.LOAD_PLATFORM + '.' +
|
||||
self.domain, load_platform_callback)
|
||||
|
||||
def extract_from_service(self, service):
|
||||
"""Extract all known entities from a service call.
|
||||
|
Loading…
x
Reference in New Issue
Block a user