Fix Z-Wave JS Node Config Panel handling null values (#8710)

* attempt fix for null values

* cleanup
This commit is contained in:
Charles Garwood 2021-03-24 14:02:45 -04:00 committed by GitHub
parent 9aaaaae175
commit a5c6ffd1b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -301,11 +301,10 @@ class ZWaveJSNodeConfig extends SubscribeMixin(LitElement) {
return;
}
this._updateConfigParameter(ev.target, parseInt(ev.target.selected));
this._updateConfigParameter(ev.target, Number(ev.target.selected));
}
private debouncedUpdate = debounce((target) => {
const value = parseInt(target.value);
private debouncedUpdate = debounce((target, value) => {
this._config![target.key].value = value;
this._updateConfigParameter(target, value);
@ -315,10 +314,11 @@ class ZWaveJSNodeConfig extends SubscribeMixin(LitElement) {
if (ev.target === undefined || this._config![ev.target.key] === undefined) {
return;
}
if (this._config![ev.target.key].value === parseInt(ev.target.value)) {
const value = Number(ev.target.value);
if (Number(this._config![ev.target.key].value) === value) {
return;
}
this.debouncedUpdate(ev.target);
this.debouncedUpdate(ev.target, value);
}
private _updateConfigParameter(target, value) {