Improve discovering upnp/igd device by always using the SSDP-discovery for the Unique Device Name#111487
Merged
Merged
Conversation
Contributor
Author
|
If possible, please don't add this to |
Member
|
If youre insecure about the end result of this change maybe not put it in milestone 2024.3.1? |
Contributor
Author
|
I feel confident enough to include it now. At the time when I created this PR there was no 2024.3.b0 milestone, only one for 2024.2. |
balloob
approved these changes
Mar 12, 2024
Merged
| "mock_mac_address_from_host", | ||
| ) | ||
| async def test_flow_ssdp_with_mismatched_udn(hass: HomeAssistant) -> None: | ||
| """Test config flow: discovered + configured through ssdp, where the UDN differs in the SSDP-discovery vs device description.""" |
Member
There was a problem hiding this comment.
Please limit docstring lines to 72 characters per line, in accordance with PEP8.
The first line is a header and should be a single sentence. After that an optional body can follow separated from the header by a blank line.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change
Instead of using/storing the UDN from the device description, store the UDN from the SSDP discovery. The latter is used to find the device when initializing the component. Normally, the UDN should be the same in both the SSDP communication and the device description, but alas, broken UPnP implementations exist.
This should fix #110216, and hopefully not break any existing installations. If any new issues arise after this change, the plan is to revert this change.
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.To help with the load of incoming pull requests: