-
Notifications
You must be signed in to change notification settings - Fork 529
Sonos: Remove Hardcoded Ports #2855
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -421,12 +421,11 @@ function sonos_ssdp.spawn_persistent_ssdp_task() | |
|
|
||
| if is_new_information then | ||
| local headers = SonosApi.make_headers() | ||
| local discovery_info, err = SonosApi.RestApi.get_player_info( | ||
| net_url.parse( | ||
| string.format("https://%s:%s", sonos_ssdp_info.ip, 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) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the switch from
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These should be the same.
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 For consistency, I wonder if we should be using |
||
| ) | ||
| local discovery_info, err = SonosApi.RestApi.get_player_info(base_url, headers) | ||
| if not discovery_info then | ||
| log.error(string.format("Error getting discovery info from SSDP response: %s", err)) | ||
| elseif discovery_info._objectType == "globalError" then | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.