@@ -128,18 +128,21 @@ class NovaStarInstance extends InstanceBase {
128128 }
129129
130130 async init ( config ) {
131+ if ( config . modelID && nova_config . CONFIG_MODEL [ config . modelID ] == undefined ) {
132+ config . modelID = undefined
133+ }
131134 this . config = config
132135
133- if ( this . config . modelID !== undefined ) {
136+ if ( this . config . modelID ) {
134137 this . model = nova_config . CONFIG_MODEL [ this . config . modelID ]
135- }
136138
137- // this is not called by Companion directly, so we need to call this to load the actions into Companion
138- this . init_variables ( )
139- this . updateActions ( )
139+ // this is not called by Companion directly, so we need to call this to load the actions into Companion
140+ this . init_variables ( )
141+ this . updateActions ( )
140142
141- // start up the TCP socket and attmept to get connected to the NovaStar device
142- this . initTCP ( )
143+ // start up the TCP socket and attmept to get connected to the NovaStar device
144+ this . initTCP ( )
145+ }
143146 }
144147
145148 // calculates the checksum for dynamic commands
@@ -174,12 +177,10 @@ class NovaStarInstance extends InstanceBase {
174177 this . updateStatus ( InstanceStatus . Disconnected , 'disconnected' )
175178 }
176179
177- if ( this . config . port === undefined ) {
178- // use TCP port 5200 by default
179- this . config . port = 5200
180- }
180+ // use TCP port 5200 by default
181+ this . config . port = 5200
181182
182- if ( this . config . modelID == 'vxpro ' ) {
183+ if ( this . config . modelID == 'vxPro ' ) {
183184 this . config . port = 15200
184185 }
185186
@@ -369,7 +370,7 @@ class NovaStarInstance extends InstanceBase {
369370 // and we need to re-connect the socket to the new address)
370371 let resetConnection = false
371372
372- if ( this . config . host != config . host ) {
373+ if ( this . config . host != config . host || this . config . modelID != config . modelID ) {
373374 resetConnection = true
374375 }
375376
0 commit comments