mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 19:56:42 +00:00
Zwave JS display allowed range of config values (#21892)
* Zwave: Display allowed range of config values, catch wrong values * allow min and max * Update zwave_js-node-config.ts
This commit is contained in:
parent
484bed4dab
commit
8bc9927ee2
@ -275,6 +275,11 @@ class ZWaveJSNodeConfig extends LitElement {
|
|||||||
.disabled=${!item.metadata.writeable}
|
.disabled=${!item.metadata.writeable}
|
||||||
@change=${this._numericInputChanged}
|
@change=${this._numericInputChanged}
|
||||||
.suffix=${item.metadata.unit}
|
.suffix=${item.metadata.unit}
|
||||||
|
.helper=${this.hass.localize(
|
||||||
|
"ui.panel.config.zwave_js.node_config.between_min_max",
|
||||||
|
{ min: item.metadata.min, max: item.metadata.max }
|
||||||
|
)}
|
||||||
|
helperPersistent
|
||||||
>
|
>
|
||||||
</ha-textfield>`;
|
</ha-textfield>`;
|
||||||
}
|
}
|
||||||
@ -356,6 +361,19 @@ class ZWaveJSNodeConfig extends LitElement {
|
|||||||
if (Number(this._config![ev.target.key].value) === value) {
|
if (Number(this._config![ev.target.key].value) === value) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (
|
||||||
|
(ev.target.min !== undefined && value < ev.target.min) ||
|
||||||
|
(ev.target.max !== undefined && value > ev.target.max)
|
||||||
|
) {
|
||||||
|
this.setError(
|
||||||
|
ev.target.key,
|
||||||
|
this.hass.localize(
|
||||||
|
"ui.panel.config.zwave_js.node_config.error_not_in_range",
|
||||||
|
{ min: ev.target.min, max: ev.target.max }
|
||||||
|
)
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.setResult(ev.target.key, undefined);
|
this.setResult(ev.target.key, undefined);
|
||||||
this._updateConfigParameter(ev.target, value);
|
this._updateConfigParameter(ev.target, value);
|
||||||
}
|
}
|
||||||
|
@ -4895,6 +4895,8 @@
|
|||||||
"zwave_js_device_database": "Z-Wave JS Device Database",
|
"zwave_js_device_database": "Z-Wave JS Device Database",
|
||||||
"battery_device_notice": "Battery devices must be awake to update their config. Please refer to your device manual for instructions on how to wake the device.",
|
"battery_device_notice": "Battery devices must be awake to update their config. Please refer to your device manual for instructions on how to wake the device.",
|
||||||
"parameter_is_read_only": "This parameter is read-only.",
|
"parameter_is_read_only": "This parameter is read-only.",
|
||||||
|
"between_min_max": "Between {min} and {max}",
|
||||||
|
"error_not_in_range": "Value must be between {min} and {max}",
|
||||||
"error_device_not_found": "Device not found",
|
"error_device_not_found": "Device not found",
|
||||||
"set_param_accepted": "The parameter has been updated.",
|
"set_param_accepted": "The parameter has been updated.",
|
||||||
"set_param_queued": "The parameter change has been queued, and will be updated when the device wakes up.",
|
"set_param_queued": "The parameter change has been queued, and will be updated when the device wakes up.",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user