Conversation
c9436f8 to
5e1f30f
Compare
|
Minimum allowed coverage is Generated by 🐒 cobertura-action against b95daf3 |
Test Results 72 files 494 suites 0s ⏱️ Results for commit b95daf3. ♻️ This comment has been updated with latest results. |
|
Invitation URL: |
| headers | ||
| local parsed_wss_url = net_url.parse(sonos_ssdp_info.wss_url) or {} | ||
| local base_url = net_url.parse( | ||
| string.format("https://%s:%s", parsed_wss_url.host, parsed_wss_url.port or SonosApi.DEFAULT_SONOS_PORT) |
There was a problem hiding this comment.
Why the switch from sonos_ssdp_info.ip to parsed_wss_url.host? Is sonos_ssdp_info.wss_url guaranteed to be present with at least a hostname?
There was a problem hiding this comment.
These should be the same. ip is parsed from the LOCATION header of the response:
A URL for more information about the device from the
group_description.xml file.
wss_url is parsed from the WEBSOCK.SMARTSPEAKER.AUD IO header:
The WebSocket URL.
Using the websocket url ip is consistent with the other rest call in the PR, but I don't know if one is better to use than the other.
After we get the discovery info here, we combine it with the ssdp info and generate the rest url from ip in the ssdp info. Eventually, the rest url gets set as a device field and is used for the other rest calls not in this PR (as they already use the provided port over the default).
For consistency, I wonder if we should be using ip here and then change the other call in the PR to use device:get_field(PlayerFields.REST_URL) example where we get it from device field
There was a problem hiding this comment.
Since I agree, these should be the same thing (I'd have been able to explain it less eloquently) and since we've shown with an on-device test that ssdp discovery works as expected, I am going to leave this as-is.
| headers | ||
| local parsed_wss_url = net_url.parse(sonos_ssdp_info.wss_url) or {} | ||
| local base_url = net_url.parse( | ||
| string.format("https://%s:%s", parsed_wss_url.host, parsed_wss_url.port or SonosApi.DEFAULT_SONOS_PORT) |
There was a problem hiding this comment.
These should be the same. ip is parsed from the LOCATION header of the response:
A URL for more information about the device from the
group_description.xml file.
wss_url is parsed from the WEBSOCK.SMARTSPEAKER.AUD IO header:
The WebSocket URL.
Using the websocket url ip is consistent with the other rest call in the PR, but I don't know if one is better to use than the other.
After we get the discovery info here, we combine it with the ssdp info and generate the rest url from ip in the ssdp info. Eventually, the rest url gets set as a device field and is used for the other rest calls not in this PR (as they already use the provided port over the default).
For consistency, I wonder if we should be using ip here and then change the other call in the PR to use device:get_field(PlayerFields.REST_URL) example where we get it from device field
Description of Change
Let the port being used be defined by the websocket in all cases rather than being hardcoded.
Summary of Completed Tests
Onboarding and using of favorites was tested on-device.