From 55c6112a28f25223ba54085520f5b544c9503285 Mon Sep 17 00:00:00 2001 From: Michael <35783820+mib1185@users.noreply.github.com> Date: Sat, 2 Apr 2022 21:34:12 +0200 Subject: [PATCH] ignore ip6 link local address on ssdp discovery (#69135) --- homeassistant/components/fritz/config_flow.py | 4 ++++ homeassistant/components/fritz/strings.json | 1 + homeassistant/components/fritz/translations/en.json | 12 +----------- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/homeassistant/components/fritz/config_flow.py b/homeassistant/components/fritz/config_flow.py index 17457522bb0..ebc5512f920 100644 --- a/homeassistant/components/fritz/config_flow.py +++ b/homeassistant/components/fritz/config_flow.py @@ -1,6 +1,7 @@ """Config flow to configure the FRITZ!Box Tools integration.""" from __future__ import annotations +import ipaddress import logging import socket from typing import Any @@ -129,6 +130,9 @@ class FritzBoxToolsFlowHandler(ConfigFlow, domain=DOMAIN): ) self.context[CONF_HOST] = self._host + if ipaddress.ip_address(self._host).is_link_local: + return self.async_abort(reason="ignore_ip6_link_local") + if uuid := discovery_info.upnp.get(ssdp.ATTR_UPNP_UDN): if uuid.startswith("uuid:"): uuid = uuid[5:] diff --git a/homeassistant/components/fritz/strings.json b/homeassistant/components/fritz/strings.json index 49a89b6e43f..9d6628aca0e 100644 --- a/homeassistant/components/fritz/strings.json +++ b/homeassistant/components/fritz/strings.json @@ -32,6 +32,7 @@ "abort": { "already_in_progress": "[%key:common::config_flow::abort::already_in_progress%]", "already_configured": "[%key:common::config_flow::abort::already_configured_device%]", + "ignore_ip6_link_local": "IPv6 link local address is not supported.", "reauth_successful": "[%key:common::config_flow::abort::reauth_successful%]" }, "error": { diff --git a/homeassistant/components/fritz/translations/en.json b/homeassistant/components/fritz/translations/en.json index f44c41f2ef9..e7ee1568684 100644 --- a/homeassistant/components/fritz/translations/en.json +++ b/homeassistant/components/fritz/translations/en.json @@ -3,13 +3,13 @@ "abort": { "already_configured": "Device is already configured", "already_in_progress": "Configuration flow is already in progress", + "ignore_ip6_link_local": "IPv6 link local address is not supported.", "reauth_successful": "Re-authentication was successful" }, "error": { "already_configured": "Device is already configured", "already_in_progress": "Configuration flow is already in progress", "cannot_connect": "Failed to connect", - "connection_error": "Failed to connect", "invalid_auth": "Invalid authentication", "upnp_not_configured": "Missing UPnP settings on device." }, @@ -31,16 +31,6 @@ "description": "Update FRITZ!Box Tools credentials for: {host}.\n\nFRITZ!Box Tools is unable to log in to your FRITZ!Box.", "title": "Updating FRITZ!Box Tools - credentials" }, - "start_config": { - "data": { - "host": "Host", - "password": "Password", - "port": "Port", - "username": "Username" - }, - "description": "Setup FRITZ!Box Tools to control your FRITZ!Box.\nMinimum needed: username, password.", - "title": "Setup FRITZ!Box Tools - mandatory" - }, "user": { "data": { "host": "Host",