Use suggestd_value instead of default in Monoprice options flow#35107
Conversation
MartinHjelmare
left a comment
There was a problem hiding this comment.
Are we depending on the frontend version where this is available?
It's good to give some context when using new features of the frontend like linking to the frontend PR:
home-assistant/frontend#5603
| if str(index) in previous_sources: | ||
| key = vol.Optional(source, default=previous_sources[str(index)]) | ||
| key = vol.Optional( | ||
| source, description={"suggested_value": previous_sources[str(index)]} |
There was a problem hiding this comment.
Has suggested_value been documented in our developer docs?
There was a problem hiding this comment.
It hasn't. I couldn't find any place where the use of schema for config flows was documented at all, so didn't really know where to put this.
More than happy to update the docs to reflect this if there's a relevant place.
There was a problem hiding this comment.
Please document it here:
https://developers.home-assistant.io/docs/data_entry_flow_index#show-form
There was a problem hiding this comment.
|
Thanks. I updated the description to link to the relevant PR. |
|
Has the frontend version where this is available been released? |
|
Not yet. It can still work with the current version (which will just ignore the suggested value), but will not have source names pre-filled. |
Proposed change
Use suggested value (instead of default) for source names, so they can be easily removed in the options flow.
See home-assistant/frontend#5603 for more detail on the use of suggested values and the differences compared to default values.
Type of change
Additional information
Checklist
black --fast 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..coveragerc.The integration reached or maintains the following Integration Quality Scale: