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:
On Freund
2020-05-01 11:36:51 +03:00
committed by GitHub
parent dfd9bf3c64
commit 1687d90d02
3 changed files with 10 additions and 3 deletions

View File

@@ -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;
}
});