@@ -59,15 +59,15 @@ export class MosHandler {
5959 private _logger : Winston . Logger
6060 private _disposed = false
6161 private _settings ?: MosGatewayConfig
62- private _hotStandby : boolean
62+ private _openMediaHotStandby : Record < string , boolean >
6363 private _coreHandler : CoreHandler | undefined
6464 private _observers : Array < Observer < any > > = [ ]
6565 private _triggerupdateDevicesTimeout : any = null
6666 private mosTypes : MosTypes
6767
6868 constructor ( logger : Winston . Logger ) {
6969 this . _logger = logger
70- this . _hotStandby = false
70+ this . _openMediaHotStandby = { }
7171 this . mosTypes = getMosTypes ( this . strict ) // temporary, another will be set upon init()
7272 }
7373 async init ( config : MosConfig , coreHandler : CoreHandler ) : Promise < void > {
@@ -243,7 +243,11 @@ export class MosHandler {
243243
244244 if ( ! this . _coreHandler ) throw Error ( '_coreHandler is undefined!' )
245245
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+ )
247251 // this._logger.info('mosDevice registered -------------')
248252 // Setup message flow between the devices:
249253
@@ -420,7 +424,8 @@ export class MosHandler {
420424 for ( const [ deviceId , device ] of Object . entries < { options : MosDeviceConfig } > ( devices ) ) {
421425 if ( device ) {
422426 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
424429 // If the host isn't set, don't use secondary:
425430 if ( ! device . options . secondary . host || ! device . options . secondary . id )
426431 delete device . options . secondary
0 commit comments