This commit is contained in:
Mateusz Gruszczyński
2026-09-01 09:19:33 +02:00
parent ac5a464d96
commit 1a5c1305dc
20 changed files with 200 additions and 42 deletions
+7 -3
View File
@@ -133,11 +133,15 @@ function validateForm(form) {
showFieldError(entity, entity?.value?.trim() ? tr('validation.entityId') : tr('validation.required'));
valid = false;
}
[
const zoneDecimalFields = [
['cool_comfort_setpoint',8,30],['cool_sleep_setpoint',8,30],['cool_away_setpoint',8,30],
['heat_comfort_setpoint',8,30],['heat_sleep_setpoint',8,30],['heat_away_setpoint',8,30],
['hysteresis',0.1,5],['max_sensor_difference',0.1,20],['standby_offset_c',0.5,8]
].forEach(([name,min,max]) => { if (!validateDecimalField(form,name,min,max)) valid = false; });
['max_sensor_difference',0.1,20],['standby_offset_c',0.5,8],
...(form.elements.separate_hysteresis?.checked
? [['cool_hysteresis',0.1,5],['heat_hysteresis',0.1,5]]
: [['hysteresis',0.1,5]])
];
zoneDecimalFields.forEach(([name,min,max]) => { if (!validateDecimalField(form,name,min,max)) valid = false; });
}
if (!valid) {