mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
must have one button type selected
This commit is contained in:
@@ -164,21 +164,23 @@ const SchedulerDialog = ({
|
|||||||
exclusive
|
exclusive
|
||||||
disabled={!creating}
|
disabled={!creating}
|
||||||
onChange={(_event, flag: ScheduleFlag) => {
|
onChange={(_event, flag: ScheduleFlag) => {
|
||||||
setFieldErrors(undefined); // clear any validation errors
|
if (flag !== null) {
|
||||||
setScheduleType(flag);
|
setFieldErrors(undefined); // clear any validation errors
|
||||||
// wipe the time field when changing the schedule type
|
setScheduleType(flag);
|
||||||
setEditItem({ ...editItem, time: '' });
|
// wipe the time field when changing the schedule type
|
||||||
// set the flags based on type
|
setEditItem({ ...editItem, time: '' });
|
||||||
// 0-127 is day schedule
|
// set the flags based on type
|
||||||
// 128 is timer
|
// 0-127 is day schedule
|
||||||
// 129 is on change
|
// 128 is timer
|
||||||
// 130 is on condition
|
// 129 is on change
|
||||||
// 132 is immediate
|
// 130 is on condition
|
||||||
setEditItem(
|
// 132 is immediate
|
||||||
flag === ScheduleFlag.SCHEDULE_DAY
|
setEditItem(
|
||||||
? { ...editItem, flags: 0 }
|
flag === ScheduleFlag.SCHEDULE_DAY
|
||||||
: { ...editItem, flags: flag }
|
? { ...editItem, flags: 0 }
|
||||||
);
|
: { ...editItem, flags: flag }
|
||||||
|
);
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ToggleButton value={ScheduleFlag.SCHEDULE_DAY}>
|
<ToggleButton value={ScheduleFlag.SCHEDULE_DAY}>
|
||||||
|
|||||||
Reference in New Issue
Block a user