Add manual config flow for Plex#34476
Conversation
|
I'm adding in the functionality to configure with only a token to match the YAML feature. |
|
Waiting for home-assistant/frontend#5612 as I'd like to use it here. |
28f8a7d to
9486d17
Compare
9486d17 to
a6c4662
Compare
| "step": { | ||
| "user": { | ||
| "title": "Plex Media Server", | ||
| "description": "Continue to <a href=\"https://plex.tv\" target=\"_blank\">plex.tv</a> to link a Plex server.", |
There was a problem hiding this comment.
This description seems weird. Can we make it so that manual_setup is not a checkbox but that we offer 2 options:
- Configure by logging in to Plex.tv
- Manually enter server details
There was a problem hiding this comment.
So we use vol.In. We can look at ha-form to see if we can render radio buttons if < 5 options or so.
There was a problem hiding this comment.
The manual setup option will only be visible to those with advanced mode enabled. Most users will only see the description and a button to continue.
I'm trying to suggest in the language that proceeding is the recommended option and that a manual config is not.
There was a problem hiding this comment.
Ah yes, the description is shared between normal and advanced mode :( We could change that by using different steps ?
There was a problem hiding this comment.
That should be doable.
a6c4662 to
6facde0
Compare
| data_schema = vol.Schema( | ||
| { | ||
| vol.Required("setup_method", default=AUTOMATIC_SETUP_STRING): vol.In( | ||
| [AUTOMATIC_SETUP_STRING, MANUAL_SETUP_STRING] |
There was a problem hiding this comment.
Oh idea. We could call async_get_translations from helpers/translation.py
There was a problem hiding this comment.
oh I guess we don't have the used language, never mind.
There was a problem hiding this comment.
we need a better solution for translating a vol.In (in a future PR)
Proposed change
In preparation for a potential removal of YAML configuration, this will bring functional parity to the config flow.
Type of change
Additional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
The integration reached or maintains the following Integration Quality Scale: