diff --git a/CHANGELOG.md b/CHANGELOG.md index ec6567a..7319b6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# Version 4.6.3 + +- Add load-tr to load Trunk Recorder talkgroups csv. +- Move back keypadsBeeps presets to backend. +- Change config.options.useDimmer to config.options.dimmerDelay. + # Version 4.6 - Fix documentation in regards to load-rrd in install-github.md. diff --git a/client/src/app/components/rdio-scanner/rdio-scanner.component.html b/client/src/app/components/rdio-scanner/rdio-scanner.component.html index 12d9da8..efbab7d 100644 --- a/client/src/app/components/rdio-scanner/rdio-scanner.component.html +++ b/client/src/app/components/rdio-scanner/rdio-scanner.component.html @@ -220,7 +220,7 @@
-
diff --git a/client/src/app/components/rdio-scanner/rdio-scanner.component.ts b/client/src/app/components/rdio-scanner/rdio-scanner.component.ts index 9d149be..6271ed2 100644 --- a/client/src/app/components/rdio-scanner/rdio-scanner.component.ts +++ b/client/src/app/components/rdio-scanner/rdio-scanner.component.ts @@ -835,14 +835,12 @@ export class AppRdioScannerComponent implements AfterViewInit, OnDestroy { } private updateDimmer(): void { - if (this.config?.useDimmer) { - const delay = typeof this.config.useDimmer === 'boolean' ? 5000 : this.config.useDimmer * 1000; - + if (typeof this.config?.dimmerDelay === 'number') { this.dimmerTimer?.unsubscribe(); this.dimmer = true; - this.dimmerTimer = timer(delay).subscribe(() => { + this.dimmerTimer = timer(this.config.dimmerDelay).subscribe(() => { this.dimmerTimer?.unsubscribe(); this.dimmerTimer = undefined; diff --git a/client/src/app/components/rdio-scanner/rdio-scanner.service.ts b/client/src/app/components/rdio-scanner/rdio-scanner.service.ts index d64399e..68a4c85 100644 --- a/client/src/app/components/rdio-scanner/rdio-scanner.service.ts +++ b/client/src/app/components/rdio-scanner/rdio-scanner.service.ts @@ -71,9 +71,9 @@ export class AppRdioScannerService implements OnDestroy { private config: RdioScannerConfig = { allowDownload: true, + dimmerDelay: false, keypadBeeps: false, systems: [], - useDimmer: true, useGroup: true, }; diff --git a/client/src/app/components/rdio-scanner/rdio-scanner.ts b/client/src/app/components/rdio-scanner/rdio-scanner.ts index 3c48a58..f3635de 100644 --- a/client/src/app/components/rdio-scanner/rdio-scanner.ts +++ b/client/src/app/components/rdio-scanner/rdio-scanner.ts @@ -72,9 +72,9 @@ export interface RdioScannerCallSource { export interface RdioScannerConfig { allowDownload: boolean; + dimmerDelay: number | false; keypadBeeps: RdioScannerKeypadBeeps | false; systems: RdioScannerSystem[]; - useDimmer: boolean | number; useGroup: boolean; } diff --git a/docs/config.md b/docs/config.md index 90d374a..b3ab16a 100644 --- a/docs/config.md +++ b/docs/config.md @@ -58,6 +58,10 @@ This file is at the heart of [Rdio Scanner](https://github.com/chuot/rdio-scanne // (boolean) Can users download archived calls. Default value is true "allowDownload": true, + // (number) Delay in milliseconds before turning off the screen backlight when inactive + // Default value is 5000 milliseconds + "dimmerDelay": 5000, + // (boolean) Disable the audio format conversion to m4a/aac // Default value is false "disableAudioConversion": false, @@ -72,11 +76,6 @@ This file is at the heart of [Rdio Scanner](https://github.com/chuot/rdio-scanne // Specifying a value of 0 will disable this feature "pruneDays": 7, - // (boolean | number) Turn off the screen backlight when it is inactive - // You can specify the delay as a number of seconds - // Default value is true which the same as 5 seconds - "useDimmer": true, - // (boolean) Also toggle talkgroups based on their group assignment // Default value is true // See Systems section below for more details on groups diff --git a/server/lib/rdio-scanner/controller.js b/server/lib/rdio-scanner/controller.js index d05d78a..f1c5744 100644 --- a/server/lib/rdio-scanner/controller.js +++ b/server/lib/rdio-scanner/controller.js @@ -255,17 +255,17 @@ class Controller extends EventEmitter { getOptions() { const options = this.config.options; + const dimmerDelay = this.config.options.dimmerDelay; + const keypadBeeps = options.keypadBeeps === false ? false : options.keypadBeeps === 1 ? defaults.keypadBeeps.uniden : options.keypadBeeps === 2 ? defaults.keypadBeeps.whistler : options.keypadBeeps !== null && typeof options.keypadBeeps === 'object' ? options.keypadBeeps : defaults.keypadBeeps.uniden; - const useDimmer = this.config.options.keypadBeeps; - const useGroup = this.config.options.useGroup; - return { keypadBeeps, useDimmer, useGroup }; + return { dimmerDelay, keypadBeeps, useGroup }; } getScope(token, store = this.config.access) { @@ -601,6 +601,9 @@ function parseConfig(config) { delete config.allowDownload; } + config.options.dimmerDelay = typeof config.options.dimmerDelay === 'number' && config.options.dimmerDelay > 0 + ? config.options.dimmerDelay : 5000; + config.options.disableAudioConversion = typeof config.options.disableAudioConversion === 'boolean' ? config.options.disableAudioConversion : typeof config.disableAudioConversion === 'boolean' ? config.disableAudioConversion : false; @@ -690,11 +693,11 @@ function parseConfig(config) { delete config.pruneDays; } - config.options.useDimmer = typeof config.options.useDimmer === 'number' ? config.options.useDimmer - : typeof config.options.useDimmer === 'boolean' ? config.options.useDimmer - : typeof config.useDimmer === 'boolean' ? config.useDimmer : true; + if (config.options.useDimmer !== undefined) { + delete config.options.useDimmer; + } - if (config.useDimmer !== null || config.useDimmer !== undefined) { + if (config.useDimmer !== undefined) { delete config.useDimmer; }