-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
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
Add Linkplay mTLS/HTTPS and improve logging #124307
Conversation
Hey there @Velleman, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
f19d8d2
to
d69a5fe
Compare
Is that upadted now? |
Address old comments in 113940
Yes the necessary changes have been made in https://github.com/Velleman/python-linkplay/releases/tag/v0.0.9 and have now been implemented in this branch |
What's the next step for this pull request? |
Mostly not forgetting about it and pressing the merge button |
* Work * Implement 0.0.8 changes, fixup tests * Cleanup * Implement new playmodes, close clientsession upon ha close * Implement new playmodes, close clientsession upon ha close * Add test for zeroconf bridge failure * Bump 0.0.9 Address old comments in 113940 * Exact _async_register_default_clientsession_shutdown
@@ -4,3 +4,4 @@ | |||
|
|||
DOMAIN = "linkplay" | |||
PLATFORMS = [Platform.MEDIA_PLAYER] | |||
CONF_SESSION = "session" |
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.
We don't prefix constants with CONF_
unless it's a key used for configuration. Use eg DATA_SESSION
instead.
* Work * Implement 0.0.8 changes, fixup tests * Cleanup * Implement new playmodes, close clientsession upon ha close * Implement new playmodes, close clientsession upon ha close * Add test for zeroconf bridge failure * Bump 0.0.9 Address old comments in 113940 * Exact _async_register_default_clientsession_shutdown
Proposed change
This PR adds new HTTPS/mTLS functionality for LinkPlay devices that do not support HTTPAPI over HTTP. This allows more devices such as the WiiM to work with HomeAssistant which was noted in #123088.
Specifically, constructing a
LinkPlayBridge
now happens throughlinkplay_factory_httpapi_bridge
, which will automatically try both HTTPS and downstepping to HTTP. The function throws aLinkPlayRequestException
if noLinkPlayBridge
was able to be created, allowing for additional logging.Additionally, new media sources have been added and tests now use
@pytest.mark.usefixtures
as per recommendation.Requires
python-linkplay==0.0.9
to provide the async creation ofSSLContext
andClientSession
that loads the mTLS certificate. https://github.com/Velleman/python-linkplay/releases/tag/v0.0.9Type 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: