diff --git a/apps/server/src/api-integration/integration.controller.ts b/apps/server/src/api-integration/integration.controller.ts index a9e83e035f..ded76835e3 100644 --- a/apps/server/src/api-integration/integration.controller.ts +++ b/apps/server/src/api-integration/integration.controller.ts @@ -241,6 +241,11 @@ const actionHandlers: Record = { 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); diff --git a/apps/server/src/services/aux-timer-service/AuxTimerService.ts b/apps/server/src/services/aux-timer-service/AuxTimerService.ts index 48d9157f27..396d4cb3b3 100644 --- a/apps/server/src/services/aux-timer-service/AuxTimerService.ts +++ b/apps/server/src/services/aux-timer-service/AuxTimerService.ts @@ -57,6 +57,11 @@ export class AuxTimerService { return this.timer.setTime(duration); } + @broadcastReturn + addTime(millis: number) { + return this.timer.setTime(this.timer.state.current + millis); + } + @broadcastReturn private update() { return this.timer.update(this.getTime());