@iobroker/gui-components 10.3.2 → 10.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,8 @@ import type { IobTheme } from '../types';
3
3
  export interface ScheduleConfigSaved {
4
4
  time?: {
5
5
  exactTime: boolean;
6
+ /** The time of the day as "HH:MM" or the name of an astro event, like "sunrise" */
7
+ start: string;
6
8
  } | {
7
9
  start: string;
8
10
  end: string;
@@ -304,7 +304,13 @@ export class Schedule extends Component {
304
304
  setTimeout(() => this.onChange(this.state.schedule, true), 200);
305
305
  schedule = DEFAULT;
306
306
  }
307
- schedule = { ...DEFAULT, ...schedule };
307
+ // Only the settings of the chosen mode are saved, so everything else comes from the defaults. The parts are
308
+ // merged one by one, as a saved schedule has e.g. only the time of day in `time` and nothing else.
309
+ schedule = {
310
+ time: { ...DEFAULT.time, ...schedule.time },
311
+ period: { ...DEFAULT.period, ...schedule.period },
312
+ valid: { ...DEFAULT.valid, ...schedule.valid },
313
+ };
308
314
  schedule.valid.from ||= Schedule.now2string();
309
315
  this.refFrom = React.createRef();
310
316
  this.refTo = React.createRef();
@@ -381,13 +387,15 @@ export class Schedule extends Component {
381
387
  copy.period.yearMonth = yearMonth;
382
388
  }
383
389
  }
384
- if (copy.time?.exactTime) {
390
+ const _time = copy.time;
391
+ if (_time?.exactTime) {
392
+ // The time of the day belongs to the exact time too, without it the schedule would run at 00:00
385
393
  copy.time = {
386
- exactTime: copy.time?.exactTime,
394
+ exactTime: _time.exactTime,
395
+ start: _time.start,
387
396
  };
388
397
  }
389
398
  else {
390
- const _time = copy.time;
391
399
  copy.time = {
392
400
  start: _time.start,
393
401
  end: _time.end,