feat: allow add time to aux timer

This commit is contained in:
Carlos Valente
2024-12-01 22:20:40 +01:00
committed by Carlos Valente
parent 7dec32aea7
commit 1e8706aa73
2 changed files with 10 additions and 0 deletions
@@ -241,6 +241,11 @@ const actionHandlers: Record<string, ActionHandler> = {
const timeInMs = numberOrError(command.duration) * 1000;
reply.payload = auxTimerService.setTime(timeInMs);
}
if ('addtime' in command) {
// convert addTime in seconds to ms
const timeInMs = numberOrError(command.addtime) * 1000;
reply.payload = auxTimerService.addTime(timeInMs);
}
if ('direction' in command) {
if (command.direction === SimpleDirection.CountUp || command.direction === SimpleDirection.CountDown) {
reply.payload = auxTimerService.setDirection(command.direction);