Skip to content

Commit

Permalink
Merge pull request #66 from istnv/fix/new-module
Browse files Browse the repository at this point in the history
Bugfix: Check and report for empty host
  • Loading branch information
istnv authored Mar 20, 2023
2 parents ec1ac06 + c809ff0 commit 415f3ac
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
18 changes: 12 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,11 @@ class BAirInstance extends InstanceBase {
// a bit more processing than available in
// an upgrade script :)
if ('' == config.host) {
config.host = this.unitsFound[config.mixer].m_ip
this.saveConfig(config)
let u = this.unitsFound[config.mixer]
if (u) {
config.host = u
this.saveConfig(config)
}
}
// do we have a name for this host?
if (config.scan) {
Expand Down Expand Up @@ -488,7 +491,10 @@ class BAirInstance extends InstanceBase {
if (this.oscPort) {
this.oscPort.close()
}
if (this.config.host) {
if (!this.config.host) {
this.updateStatus(InstanceStatus.ConnectionFailure,'No host IP')
} else {
// if (this.config.host) {
this.oscPort = new OSC.UDPPort({
localAddress: '0.0.0.0',
localPort: 0,
Expand Down Expand Up @@ -588,11 +594,11 @@ class BAirInstance extends InstanceBase {
's_name': n,
['s_name_' + pad0(s)]: n,
})
self.prevSnapshot = 1>=s ? 0 : s - 1
self.nextSnapshot = 64<=s ? 0 : s + 1
self.prevSnapshot = 1 >= s ? 0 : s - 1
self.nextSnapshot = 64 <= s ? 0 : s + 1
self.setVariableValues({
's_name_p': self.xStat[self.snapshot[self.prevSnapshot]]?.name ?? '-----',
's_name_n': self.xStat[self.snapshot[self.nextSnapshot]]?.name ?? '-----',
's_name_n': self.xStat[self.snapshot[self.nextSnapshot]]?.name ?? '-----',
})
self.checkFeedbacks('snap_color')
self.sendOSC('/-snap/' + pad0(s) + '/name', [])
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "behringer-xair",
"version": "2.0.3",
"version": "2.0.4",
"type": "module",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 415f3ac

Please sign in to comment.