Add timeout parameter for LMS operations to Squeezebox#165324
Add timeout parameter for LMS operations to Squeezebox#165324peteS-UK wants to merge 2 commits intohome-assistant:devfrom
Conversation
|
Hey there @rajlaud, @pssc, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
There was a problem hiding this comment.
Pull request overview
Adds a configurable LMS request timeout option for the Squeezebox integration and wires it into multiple player control calls to better handle slow LMS/network environments.
Changes:
- Introduces a new options-flow setting
lms_timeout(default 5s) for LMS request timeouts. - Passes the configured timeout into multiple
pysqueezeboxplayer command calls viasafe_library_call. - Updates integration translations/options UI strings related to the new timeout setting.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
homeassistant/components/squeezebox/strings.json |
Adds options-flow label/description for lms_timeout and introduces a new exception string. |
homeassistant/components/squeezebox/media_player.py |
Reads lms_timeout from config entry options and supplies it to many player commands; adds extra safety wrapping for some calls. |
homeassistant/components/squeezebox/const.py |
Defines CONF_LMS_TIMEOUT and DEFAULT_LMS_TIMEOUT. |
homeassistant/components/squeezebox/config_flow.py |
Adds lms_timeout to the options schema and suggests current/default values in the options form. |
| await safe_library_call( | ||
| self._player.async_load_url, | ||
| media_id, | ||
| cmd, | ||
| self._get_options_lms_timeout(), | ||
| translation_key="load_url_failed", |
There was a problem hiding this comment.
The new lms_timeout option is applied to async_load_url(...) here, but other LMS calls in the same code path (e.g., async_load_playlist(...) and the custom async_query calls used by the services) still use the library default timeout. Consider applying the same configured timeout consistently to all LMS requests to match the option’s description.
Proposed change
Currently, the Squeezebox integration uses a default 5 second timeout for LMS API operations. This PR add a config option flow item to allow this to be configured.
WIP as it requires an underlying library fix, tests and doc update.
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.To help with the load of incoming pull requests: