@@ -59,15 +59,15 @@ export class MosHandler {
59
59
private _logger : Winston . Logger
60
60
private _disposed = false
61
61
private _settings ?: MosGatewayConfig
62
- private _hotStandby : boolean
62
+ private _openMediaHotStandby : Record < string , boolean >
63
63
private _coreHandler : CoreHandler | undefined
64
64
private _observers : Array < Observer < any > > = [ ]
65
65
private _triggerupdateDevicesTimeout : any = null
66
66
private mosTypes : MosTypes
67
67
68
68
constructor ( logger : Winston . Logger ) {
69
69
this . _logger = logger
70
- this . _hotStandby = false
70
+ this . _openMediaHotStandby = { }
71
71
this . mosTypes = getMosTypes ( this . strict ) // temporary, another will be set upon init()
72
72
}
73
73
async init ( config : MosConfig , coreHandler : CoreHandler ) : Promise < void > {
@@ -243,7 +243,11 @@ export class MosHandler {
243
243
244
244
if ( ! this . _coreHandler ) throw Error ( '_coreHandler is undefined!' )
245
245
246
- const coreMosHandler = await this . _coreHandler . registerMosDevice ( mosDevice , this , this . _hotStandby )
246
+ const coreMosHandler = await this . _coreHandler . registerMosDevice (
247
+ mosDevice ,
248
+ this ,
249
+ mosDevice . idSecondary ? this . _openMediaHotStandby [ mosDevice . idSecondary ] : false
250
+ )
247
251
// this._logger.info('mosDevice registered -------------')
248
252
// Setup message flow between the devices:
249
253
@@ -420,7 +424,8 @@ export class MosHandler {
420
424
for ( const [ deviceId , device ] of Object . entries < { options : MosDeviceConfig } > ( devices ) ) {
421
425
if ( device ) {
422
426
if ( device . options . secondary ) {
423
- this . _hotStandby = device . options . secondary ?. hotStandby || false
427
+ this . _openMediaHotStandby [ device . options . secondary . id ] =
428
+ device . options . secondary ?. openMediaHotStandby || false
424
429
// If the host isn't set, don't use secondary:
425
430
if ( ! device . options . secondary . host || ! device . options . secondary . id )
426
431
delete device . options . secondary
0 commit comments