mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-26 18:56:39 +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) {
|
if (item) {
|
||||||
this._name = item.name || "";
|
this._name = item.name || "";
|
||||||
this._icon = item.icon || "";
|
this._icon = item.icon || "";
|
||||||
this._maximum = item.maximum;
|
this._maximum = item.maximum ?? undefined;
|
||||||
this._minimum = item.minimum;
|
this._minimum = item.minimum ?? undefined;
|
||||||
this._restore = item.restore ?? true;
|
this._restore = item.restore ?? true;
|
||||||
this._step = item.step ?? 1;
|
this._step = item.step ?? 1;
|
||||||
this._initial = item.initial ?? 0;
|
this._initial = item.initial ?? 0;
|
||||||
@ -163,7 +163,9 @@ class HaCounterForm extends LitElement {
|
|||||||
const configValue = target.configValue;
|
const configValue = target.configValue;
|
||||||
const value =
|
const value =
|
||||||
target.type === "number"
|
target.type === "number"
|
||||||
? Number(ev.detail.value)
|
? ev.detail.value !== ""
|
||||||
|
? Number(ev.detail.value)
|
||||||
|
: undefined
|
||||||
: target.localName === "ha-switch"
|
: target.localName === "ha-switch"
|
||||||
? (ev.target as HaSwitch).checked
|
? (ev.target as HaSwitch).checked
|
||||||
: ev.detail.value;
|
: ev.detail.value;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user