deCONZ migrate to SSDP discovery (#24252)
* Migrate deCONZ to use new SSDP discovery Add new discovery info manufacturer URL to be able to separate Hue and deCONZ bridges * Mark deCONZ as migrated in Discovery component * Fix tests * Fix Hue discovery ignore deCONZ bridge * Less snake more badger * Mushroom * Fix indentation * Config flow ignore manufacturer url that is not philips
This commit is contained in:
parent
7fd2e67d11
commit
449a7d3fd5
10 changed files with 78 additions and 20 deletions
|
@ -8,6 +8,7 @@ import async_timeout
|
|||
import voluptuous as vol
|
||||
|
||||
from homeassistant import config_entries
|
||||
from homeassistant.components.ssdp import ATTR_MANUFACTURERURL
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.helpers import aiohttp_client
|
||||
|
||||
|
@ -15,6 +16,8 @@ from .bridge import get_bridge
|
|||
from .const import DOMAIN, LOGGER
|
||||
from .errors import AuthenticationRequired, CannotConnect
|
||||
|
||||
HUE_MANUFACTURERURL = 'http://www.philips.com'
|
||||
|
||||
|
||||
@callback
|
||||
def configured_hosts(hass):
|
||||
|
@ -143,6 +146,9 @@ class HueFlowHandler(config_entries.ConfigFlow):
|
|||
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.
|
||||
"""
|
||||
if discovery_info[ATTR_MANUFACTURERURL] != HUE_MANUFACTURERURL:
|
||||
return self.async_abort(reason='not_hue_bridge')
|
||||
|
||||
# Filter out emulated Hue
|
||||
if "HASS Bridge" in discovery_info.get('name', ''):
|
||||
return self.async_abort(reason='already_configured')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue