Add zeroconf discovery to Freebox (#47045)
* Add zeroconf discovery to Freebox - remove deprecated discovery - tried with SSDP too but the presentation URL is not the same (*.fbxos.fr for zeroconf, http://mafreebox.freebox.fr/ for SSDP) - so config entry unique_id should be the MAC (included into SSDP, but not zeroconf, can be retrieve from `fbx.system.get_config()`) - DHCP discovery might be added in the future too * host and port are required on zeroconf * cleanup in other PR
This commit is contained in:
parent
5bba532dd4
commit
125206adbf
4 changed files with 45 additions and 17 deletions
|
@ -25,26 +25,20 @@ CONFIG_SCHEMA = vol.Schema(
|
|||
|
||||
|
||||
async def async_setup(hass, config):
|
||||
"""Set up the Freebox component."""
|
||||
conf = config.get(DOMAIN)
|
||||
|
||||
if conf is None:
|
||||
return True
|
||||
|
||||
for freebox_conf in conf:
|
||||
hass.async_create_task(
|
||||
hass.config_entries.flow.async_init(
|
||||
DOMAIN,
|
||||
context={"source": SOURCE_IMPORT},
|
||||
data=freebox_conf,
|
||||
"""Set up the Freebox integration."""
|
||||
if DOMAIN in config:
|
||||
for entry_config in config[DOMAIN]:
|
||||
hass.async_create_task(
|
||||
hass.config_entries.flow.async_init(
|
||||
DOMAIN, context={"source": SOURCE_IMPORT}, data=entry_config
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
return True
|
||||
|
||||
|
||||
async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry):
|
||||
"""Set up Freebox component."""
|
||||
"""Set up Freebox entry."""
|
||||
router = FreeboxRouter(hass, entry)
|
||||
await router.setup()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue