update deps to current state of module template; update runtime to node22

This commit is contained in:
2025-06-06 17:15:26 +02:00
parent 2f9fa1cb0b
commit 34a2814c19
7 changed files with 3375 additions and 2167 deletions

View File

@@ -5,6 +5,7 @@ export interface ModuleConfig {
workspaceName: string
alwaysStart: boolean
startTimerPoller: boolean
timerPollerInterval: number
}
export function GetConfigFields(): SomeCompanionConfigField[] {
@@ -36,9 +37,18 @@ export function GetConfigFields(): SomeCompanionConfigField[] {
{
type: 'checkbox',
id: 'startTimerPoller',
label: 'Poll for current time entry every 30 seconds',
label: 'Poll for current time entry every n seconds',
width: 12,
default: false,
},
{
type: 'number',
id: 'timerPollerInterval',
label: 'Poll interval in seconds',
width: 12,
default: 60,
min: 30,
max: 3600,
},
]
}

View File

@@ -146,7 +146,7 @@ export class TogglTrack extends InstanceBase<ModuleConfig> {
void (async () => {
await this.getCurrentTimer()
})()
}, 30 * 1000)
}, this.config.timerPollerInterval * 1000)
}
private stopTimeEntryPoller(): void {
this.log('info', 'Stopping TimeEntry-Poller')