Convert Plex to config flow#26157
Conversation
|
I've just discovered that tokens can be used to authenticate a Plex account by themselves with no need to also supply the username. Will be refactoring to (hopefully) simplify things a bit. |
|
While your at it i think you should reconsider the entire login method. Plex support oauth so we could skip the username, password etc. and just pass the authtoken that we get from plex to the MyPlexAccount() from there we could create a list of servers that the user can pick. |
|
@Hellowlol That's already planned for a followup PR, but I need to get the config flow/entry in place first. |
|
Back to WIP shortly. I've thought of a better way to cache the connection URLs instead of hitting the Plex endpoints on every startup. Should make it more reliable if internet connectivity isn't available and servers are local. Should also make the stored config far more consistent. |
|
I believe this is ready for review. Docs have also been updated. A PR to automate obtaining external authorization is also ready after this is merged. |
b3057f2 to
7885300
Compare
|
Closing in favor of #26548. |
Description:
Primary changes:
configuratorsetupmedia_playersettings (configuration and plex.conf)sensorconfigurationmedia_playerandsensormedia_playerandsensorper integrationRelated issue (if applicable): fixes #18113 #22973
Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#10238
Example entry for
configuration.yaml(if applicable):Legacy configurations from both platforms are accepted and imported to a config entry with exception of
username,password, andnameoptions onsensorplatform. They can remain in the configuration but are ignored.Checklist:
tox. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
python3 -m script.hassfest.