feat: implement multiple aux timers

This commit is contained in:
Carlos Valente
2025-06-24 07:20:53 +02:00
committed by Carlos Valente
parent d1c58712ae
commit bf8ed8d017
33 changed files with 748 additions and 297 deletions
@@ -57,11 +57,20 @@ export type HTTPOutput = {
export type OntimeAction =
| {
type: 'ontime';
action: 'aux-start' | 'aux-stop' | 'aux-pause';
action:
| 'aux1-start'
| 'aux1-stop'
| 'aux1-pause'
| 'aux2-start'
| 'aux2-stop'
| 'aux2-pause'
| 'aux3-start'
| 'aux3-stop'
| 'aux3-pause';
}
| {
type: 'ontime';
action: 'aux-set';
action: 'aux1-set' | 'aux2-set' | 'aux3-set';
time: number;
}
| {
@@ -1,4 +1,4 @@
export type SecondarySource = 'aux' | 'secondary' | null;
export type SecondarySource = 'aux1' | 'aux2' | 'aux3' | 'secondary' | null;
export type TimerMessage = {
text: string;
@@ -52,5 +52,17 @@ export const runtimeStorePlaceholder: Readonly<RuntimeStore> = {
duration: 0,
playback: SimplePlayback.Stop,
},
auxtimer2: {
current: 0,
direction: SimpleDirection.CountUp,
duration: 0,
playback: SimplePlayback.Stop,
},
auxtimer3: {
current: 0,
direction: SimpleDirection.CountUp,
duration: 0,
playback: SimplePlayback.Stop,
},
ping: -1,
};
@@ -22,6 +22,8 @@ export type RuntimeStore = {
// extra timers
auxtimer1: SimpleTimerState;
auxtimer2: SimpleTimerState;
auxtimer3: SimpleTimerState;
// utils
ping: number;