Use SsdpServiceInfo for ssdp tests (part 3)#60334
Use SsdpServiceInfo for ssdp tests (part 3)#60334bdraco merged 15 commits intohome-assistant:devfrom
Conversation
| return getattr(self, name) | ||
| return self.upnp.get(name) | ||
|
|
||
| def get(self, name: str, default: Any = None) -> Any: |
There was a problem hiding this comment.
@MartinHjelmare / @bdraco / @frenck
Should I add this also to the other xxxServiceInfo?
When I migrated the others using a TypedDict in the first pass, and then using a dataclass in the second pass it didn't seem required.
Now with hindsight I think it might cause issues with custom components (ie. breaking change before 2022.6)
There was a problem hiding this comment.
Where is the code that actually needs this?
There was a problem hiding this comment.
grep "discovery_info.get(" homeassistant/components/**/**.py
As an example:
core/homeassistant/components/deconz/config_flow.py
Lines 194 to 197 in 2468724
There was a problem hiding this comment.
For zeroconf (and dhcp/usb/mqtt) they were fixed as I bumped into them.
I don't have example but I assume there will be some similar code in custom components.
There was a problem hiding this comment.
As much as I hate to have more temporary code, I think we should implement it in all places since someone will be doing it that way.
There was a problem hiding this comment.
I'll open a separate PR for the other discovery components.
This probably also applies for the __iter__ implementation in #60339
8a27448 to
8c2523b
Compare
|
Rebased since part 2 was merged. |
bdraco
left a comment
There was a problem hiding this comment.
This one took a while to go though. Hopefully the next one is a bit smaller.
Proposed change
Use
SsdpServiceInfoforSOURCE_SSDPtests (part 3) as preliminary work for #59931.They are split out from part 1/2 because the
getmethod needs to be implemented inSsdpServiceInfo(at least temporarily)Requires part 2 to be merged: #60322Type of change
Additional information
Checklist
black --fast 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.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: