Ensure explicit `false` values from customize form get stored (#10381)
This commit is contained in:
parent
a12c2eea5d
commit
b9bde1960b
|
@ -180,10 +180,16 @@ export class HaFormCustomize extends LocalizeMixin(PolymerElement) {
|
||||||
this.newAttributes
|
this.newAttributes
|
||||||
);
|
);
|
||||||
attrs.forEach((attr) => {
|
attrs.forEach((attr) => {
|
||||||
if (attr.closed || attr.secondary || !attr.attribute || !attr.value)
|
if (
|
||||||
|
attr.closed ||
|
||||||
|
attr.secondary ||
|
||||||
|
!attr.attribute ||
|
||||||
|
attr.value === null ||
|
||||||
|
attr.value === undefined
|
||||||
|
)
|
||||||
return;
|
return;
|
||||||
const value = attr.type === "json" ? JSON.parse(attr.value) : attr.value;
|
const value = attr.type === "json" ? JSON.parse(attr.value) : attr.value;
|
||||||
if (!value) return;
|
if (value === null || value === undefined) return;
|
||||||
data[attr.attribute] = value;
|
data[attr.attribute] = value;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue