diff --git a/homeassistant/components/dlna_dmr/manifest.json b/homeassistant/components/dlna_dmr/manifest.json index f844bdf987b..1295a1d221b 100644 --- a/homeassistant/components/dlna_dmr/manifest.json +++ b/homeassistant/components/dlna_dmr/manifest.json @@ -2,7 +2,7 @@ "domain": "dlna_dmr", "name": "DLNA Digital Media Renderer", "documentation": "https://www.home-assistant.io/integrations/dlna_dmr", - "requirements": ["async-upnp-client==0.21.2"], + "requirements": ["async-upnp-client==0.22.1"], "dependencies": ["network"], "codeowners": [], "iot_class": "local_push" diff --git a/homeassistant/components/ssdp/__init__.py b/homeassistant/components/ssdp/__init__.py index af8f5915f57..edb64b780c3 100644 --- a/homeassistant/components/ssdp/__init__.py +++ b/homeassistant/components/ssdp/__init__.py @@ -71,13 +71,13 @@ SsdpCallback = Callable[[Mapping[str, Any], SsdpChange], Awaitable] SSDP_SOURCE_SSDP_CHANGE_MAPPING: Mapping[SsdpSource, SsdpChange] = { - SsdpSource.SEARCH: SsdpChange.ALIVE, + SsdpSource.SEARCH_ALIVE: SsdpChange.ALIVE, + SsdpSource.SEARCH_CHANGED: SsdpChange.ALIVE, SsdpSource.ADVERTISEMENT_ALIVE: SsdpChange.ALIVE, SsdpSource.ADVERTISEMENT_BYEBYE: SsdpChange.BYEBYE, SsdpSource.ADVERTISEMENT_UPDATE: SsdpChange.UPDATE, } - _LOGGER = logging.getLogger(__name__) @@ -374,26 +374,39 @@ class Scanner: ] async def _ssdp_listener_callback( - self, ssdp_device: SsdpDevice, dst: DeviceOrServiceType, source: SsdpSource + self, + ssdp_device: SsdpDevice, + dst: DeviceOrServiceType, + source: SsdpSource, ) -> None: """Handle a device/service change.""" _LOGGER.debug( - "Change, ssdp_device: %s, dst: %s, source: %s", ssdp_device, dst, source + "SSDP: ssdp_device: %s, dst: %s, source: %s", ssdp_device, dst, source ) location = ssdp_device.location info_desc = await self._async_get_description_dict(location) or {} combined_headers = ssdp_device.combined_headers(dst) info_with_desc = CaseInsensitiveDict(combined_headers, **info_desc) - discovery_info = discovery_info_from_headers_and_description(info_with_desc) callbacks = self._async_get_matching_callbacks(combined_headers) + matching_domains: set[str] = set() + + # If there are no changes from a search, do not trigger a config flow + if source != SsdpSource.SEARCH_ALIVE: + matching_domains = self.integration_matchers.async_matching_domains( + info_with_desc + ) + + if not callbacks and not matching_domains: + return + + discovery_info = discovery_info_from_headers_and_description(info_with_desc) ssdp_change = SSDP_SOURCE_SSDP_CHANGE_MAPPING[source] await _async_process_callbacks(callbacks, discovery_info, ssdp_change) - for domain in self.integration_matchers.async_matching_domains(info_with_desc): + for domain in matching_domains: _LOGGER.debug("Discovered %s at %s", domain, location) - flow: SSDPFlow = { "domain": domain, "context": {"source": config_entries.SOURCE_SSDP}, diff --git a/homeassistant/components/ssdp/manifest.json b/homeassistant/components/ssdp/manifest.json index 1e7dec03d7d..0fecbc01282 100644 --- a/homeassistant/components/ssdp/manifest.json +++ b/homeassistant/components/ssdp/manifest.json @@ -4,7 +4,7 @@ "documentation": "https://www.home-assistant.io/integrations/ssdp", "requirements": [ "defusedxml==0.7.1", - "async-upnp-client==0.21.2" + "async-upnp-client==0.22.1" ], "dependencies": ["network"], "after_dependencies": ["zeroconf"], diff --git a/homeassistant/components/upnp/manifest.json b/homeassistant/components/upnp/manifest.json index fa71fa67751..7cf45673292 100644 --- a/homeassistant/components/upnp/manifest.json +++ b/homeassistant/components/upnp/manifest.json @@ -3,7 +3,7 @@ "name": "UPnP/IGD", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/upnp", - "requirements": ["async-upnp-client==0.21.2"], + "requirements": ["async-upnp-client==0.22.1"], "dependencies": ["network", "ssdp"], "codeowners": ["@StevenLooman","@ehendrix23"], "ssdp": [ diff --git a/homeassistant/components/yeelight/manifest.json b/homeassistant/components/yeelight/manifest.json index d0f1eee2828..90e575fb404 100644 --- a/homeassistant/components/yeelight/manifest.json +++ b/homeassistant/components/yeelight/manifest.json @@ -2,7 +2,7 @@ "domain": "yeelight", "name": "Yeelight", "documentation": "https://www.home-assistant.io/integrations/yeelight", - "requirements": ["yeelight==0.7.5", "async-upnp-client==0.21.2"], + "requirements": ["yeelight==0.7.5", "async-upnp-client==0.22.1"], "codeowners": ["@rytilahti", "@zewelor", "@shenxn", "@starkillerOG"], "config_flow": true, "dependencies": ["network"], diff --git a/homeassistant/package_constraints.txt b/homeassistant/package_constraints.txt index 4998d2c9012..2fce5d7cc7a 100644 --- a/homeassistant/package_constraints.txt +++ b/homeassistant/package_constraints.txt @@ -4,7 +4,7 @@ aiodiscover==1.4.2 aiohttp==3.7.4.post0 aiohttp_cors==0.7.0 astral==2.2 -async-upnp-client==0.21.2 +async-upnp-client==0.22.1 async_timeout==3.0.1 attrs==21.2.0 awesomeversion==21.8.1 diff --git a/requirements_all.txt b/requirements_all.txt index 420ccaaa435..48880661cfe 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -327,7 +327,7 @@ asterisk_mbox==0.5.0 # homeassistant.components.ssdp # homeassistant.components.upnp # homeassistant.components.yeelight -async-upnp-client==0.21.2 +async-upnp-client==0.22.1 # homeassistant.components.supla asyncpysupla==0.0.5 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index fae816ac909..bd537b46431 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -221,7 +221,7 @@ arcam-fmj==0.7.0 # homeassistant.components.ssdp # homeassistant.components.upnp # homeassistant.components.yeelight -async-upnp-client==0.21.2 +async-upnp-client==0.22.1 # homeassistant.components.aurora auroranoaa==0.0.2