mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-08 10:29:37 +00:00
Allow passing the current value to config flow input fields (#5603)
* Allow passing the current value to config flow input fields * Fix lint errors * Apply suggestions from code review Co-Authored-By: Bram Kragten <mail@bramkragten.nl> * Rename current_value to suggested_value to open up more use cases * Update ha-form-integer.ts Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
@@ -122,7 +122,9 @@ class StepFlowForm extends LitElement {
|
||||
|
||||
const data = {};
|
||||
this.step.data_schema.forEach((field) => {
|
||||
if ("default" in field) {
|
||||
if (field.description?.suggested_value) {
|
||||
data[field.name] = field.description.suggested_value;
|
||||
} else if ("default" in field) {
|
||||
data[field.name] = field.default;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user