Skip to content

Commit

Permalink
Fix display mode in number card editor (#1308)
Browse files Browse the repository at this point in the history
  • Loading branch information
piitaya committed Dec 4, 2023
1 parent 065b544 commit 5ae6565
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/cards/number-card/number-card-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,12 @@ export class NumberCardEditor extends MushroomBaseElement implements LovelaceCar
}

private _valueChanged(ev: CustomEvent): void {
const value = ev.detail.value;
const config = { ...ev.detail.value };

if (value.display_mode === "default") {
delete value.display_mode;
if (config.display_mode === "default") {
delete config.display_mode;
}
fireEvent(this, "config-changed", { config: ev.detail.value });

fireEvent(this, "config-changed", { config });
}
}

0 comments on commit 5ae6565

Please sign in to comment.