update deps to current state of module template; update runtime to node22
This commit is contained in:
@@ -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,
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user