Skip to content

Commit

Permalink
v2.0.3: bugfix, optimization, update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
krocheck committed Jun 6, 2023
1 parent d94be96 commit 3c4160f
Show file tree
Hide file tree
Showing 5 changed files with 192 additions and 211 deletions.
2 changes: 1 addition & 1 deletion companion/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "bmd-smartview",
"shortname": "smart",
"description": "bmd-smartview",
"version": "2.0.2",
"version": "2.0.3",
"license": "MIT",
"repository": "git+https://github.com/bitfocus/companion-module-bmd-smartview.git",
"bugs": "https://github.com/bitfocus/companion-module-bmd-smartview/issues",
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bmd-smartview",
"version": "2.0.2",
"version": "2.0.3",
"main": "src/index.js",
"type": "module",
"scripts": {
Expand All @@ -13,10 +13,10 @@
},
"license": "MIT",
"dependencies": {
"@companion-module/base": "~1.2"
"@companion-module/base": "~1.4"
},
"devDependencies": {
"@companion-module/tools": "~1.1",
"@companion-module/tools": "~1.2",
"prettier": "^2.8.3"
},
"prettier": "@companion-module/tools/.prettierrc.json"
Expand Down
54 changes: 9 additions & 45 deletions src/feedback.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ export function updateFeedbacks() {
},
options: [this.MONITOR_FIELD, Fields.Level(255)],
callback: ({ options }) => {
if (this.getMonitor(options.mon).brightness == options.val) {
return true
} else {
return false
}
return this.getMonitor(options.mon).brightness == options.val
},
}

Expand All @@ -39,11 +35,7 @@ export function updateFeedbacks() {
},
options: [this.MONITOR_FIELD, Fields.Level(127)],
callback: ({ options }) => {
if (this.getMonitor(options.mon).contrast == options.val) {
return true
} else {
return false
}
return this.getMonitor(options.mon).contrast == options.val
},
}
feedbacks['sat'] = {
Expand All @@ -56,11 +48,7 @@ export function updateFeedbacks() {
},
options: [this.MONITOR_FIELD, Fields.Level(127)],
callback: ({ options }) => {
if (this.getMonitor(options.mon).saturation == options.val) {
return true
} else {
return false
}
return this.getMonitor(options.mon).saturation == options.val
},
}
}
Expand All @@ -75,11 +63,7 @@ export function updateFeedbacks() {
},
options: [this.MONITOR_FIELD],
callback: ({ options }) => {
if (this.getMonitor(options.mon).identify === true) {
return true
} else {
return false
}
return this.getMonitor(options.mon).identify === true
},
}

Expand All @@ -93,11 +77,7 @@ export function updateFeedbacks() {
},
options: [this.MONITOR_FIELD, Fields.Color],
callback: ({ options }) => {
if (this.getMonitor(options.mon).border == options.val) {
return true
} else {
return false
}
return this.getMonitor(options.mon).border == options.val
},
}

Expand All @@ -112,11 +92,7 @@ export function updateFeedbacks() {
},
options: [this.MONITOR_FIELD, Fields.ScopeType],
callback: ({ options }) => {
if (this.getMonitor(options.mon).scopeMode == options.val) {
return true
} else {
return false
}
return this.getMonitor(options.mon).scopeMode == options.val
},
}

Expand All @@ -130,11 +106,7 @@ export function updateFeedbacks() {
},
options: [this.MONITOR_FIELD, Fields.AudioChannel],
callback: ({ options }) => {
if (this.getMonitor(options.mon).audioChannel == options.val) {
return true
} else {
return false
}
return this.getMonitor(options.mon).audioChannel == options.val
},
}
}
Expand All @@ -150,11 +122,7 @@ export function updateFeedbacks() {
},
options: [this.MONITOR_FIELD, Fields.Lut],
callback: ({ options }) => {
if (this.getMonitor(options.mon).lut == options.val) {
return true
} else {
return false
}
return this.getMonitor(options.mon).lut == options.val
},
}

Expand All @@ -168,11 +136,7 @@ export function updateFeedbacks() {
},
options: [this.MONITOR_FIELD, Fields.Input],
callback: ({ options }) => {
if (this.getMonitor(options.mon).monitorInput == options.val) {
return true
} else {
return false
}
return this.getMonitor(options.mon).monitorInput == options.val
},
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ class BlackmagicSmartviewInstance extends InstanceBase {
*/
queueCommand(cmd) {
if (cmd !== undefined) {
if (this.socket !== undefined && this.socket.connected) {
if (this.socket !== undefined && this.socket.isConnected) {
this.commandQueue.push(`${cmd}\n\n`)

if (this.cts === true) {
Expand Down
Loading

0 comments on commit 3c4160f

Please sign in to comment.