Conversation
c9436f8 to
5e1f30f
Compare
|
Minimum allowed coverage is Generated by 🐒 cobertura-action against 5e1f30f |
Test Results 72 files 495 suites 0s ⏱️ Results for commit 5e1f30f. |
|
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
| local url_ip = lb_utils.force_url_table(coordinator_player.player.websocket_url).host | ||
| local url_port = lb_utils.force_url_table(coordinator_player.player.websocket_url).port or SonosApi.DEFAULT_SONOS_PORT |
There was a problem hiding this comment.
| local url_ip = lb_utils.force_url_table(coordinator_player.player.websocket_url).host | |
| local url_port = lb_utils.force_url_table(coordinator_player.player.websocket_url).port or SonosApi.DEFAULT_SONOS_PORT | |
| local url_table = lb_utils.force_url_table(coordinator_player.player.websocket_url) | |
| local url_ip = url_table.host | |
| local url_port = url_table.port or SonosApi.DEFAULT_SONOS_PORT |
| 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