Add SSDP integration (#24090)
* Add SSDP integration * Fix tests * Sort all the things * Add netdisco to test requirements
This commit is contained in:
1 parent
97b671171b
commit
9debbfb1a8
22 files changed
+436
-28
No files matched your search
@@ -137,17 +137,22 @@ class HueFlowHandler(config_entries.ConfigFlow):
|
||||
errors=errors,
|
||||
)
|
||||
|
||||
async def async_step_discovery(self, discovery_info):
|
||||
async def async_step_ssdp(self, discovery_info):
|
||||
"""Handle a discovered Hue bridge.
|
||||
|
||||
This flow is triggered by the discovery component. It will check if the
|
||||
This flow is triggered by the SSDP component. It will check if the
|
||||
host is already configured and delegate to the import step if not.
|
||||
"""
|
||||
# Filter out emulated Hue
|
||||
if "HASS Bridge" in discovery_info.get('name', ''):
|
||||
return self.async_abort(reason='already_configured')
|
||||
|
||||
host = discovery_info.get('host')
|
||||
# pylint: disable=unsupported-assignment-operation
|
||||
host = self.context['host'] = discovery_info.get('host')
|
||||
|
||||
if any(host == flow['context']['host']
|
||||
for flow in self._async_in_progress()):
|
||||
return self.async_abort(reason='already_in_progress')
|
||||
|
||||
if host in configured_hosts(self.hass):
|
||||
return self.async_abort(reason='already_configured')
|
||||
|
||||
Reference in new issue
Block a user