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
|
||||
);
|
||||
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;
|
||||
const value = attr.type === "json" ? JSON.parse(attr.value) : attr.value;
|
||||
if (!value) return;
|
||||
if (value === null || value === undefined) return;
|
||||
data[attr.attribute] = value;
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue