mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 17:26:42 +00:00
Allow empty/undefined for counter min & max (#8154)
This commit is contained in:
parent
fd2df92000
commit
cd06b931a9
@ -44,8 +44,8 @@ class HaCounterForm extends LitElement {
|
||||
if (item) {
|
||||
this._name = item.name || "";
|
||||
this._icon = item.icon || "";
|
||||
this._maximum = item.maximum;
|
||||
this._minimum = item.minimum;
|
||||
this._maximum = item.maximum ?? undefined;
|
||||
this._minimum = item.minimum ?? undefined;
|
||||
this._restore = item.restore ?? true;
|
||||
this._step = item.step ?? 1;
|
||||
this._initial = item.initial ?? 0;
|
||||
@ -163,7 +163,9 @@ class HaCounterForm extends LitElement {
|
||||
const configValue = target.configValue;
|
||||
const value =
|
||||
target.type === "number"
|
||||
? ev.detail.value !== ""
|
||||
? Number(ev.detail.value)
|
||||
: undefined
|
||||
: target.localName === "ha-switch"
|
||||
? (ev.target as HaSwitch).checked
|
||||
: ev.detail.value;
|
||||
|
Loading…
x
Reference in New Issue
Block a user