Skip to content

Commit

Permalink
add initialization feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
josephdadams committed Mar 14, 2024
1 parent 28f9309 commit e0dcf54
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/feedbacks.js
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,39 @@ module.exports = {
return false
},
}

feedbacks.platformStatus = {
type: 'boolean',
name: 'Platform Status is in X State',
description: 'Indicate if Platform Status is in X State',
defaultStyle: {
color: foregroundColor,
bgcolor: backgroundColorOrange,
},
options: [
{
type: 'dropdown',
label: 'Indicate in X State',
id: 'option',
default: 'initialized',
choices: [
{ id: 'unitialize', label: 'Uninitialized' },
{ id: 'initialized', label: 'Initialized' },
],
},
],
callback: function (feedback, bank) {
let opt = feedback.options;

if (self.data.platformStatus) {
if (self.data.platformStatus == opt.option) {
return true
}
}

return false
},
}
}

self.setFeedbackDefinitions(feedbacks);
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class canonptzInstance extends InstanceBase {
imageStabilization: '',
firmwareVersion: '',
protocolVersion: '',
platformStatus: '',

//Zoom/Focus
zoomSpeed: 8,
Expand Down
3 changes: 3 additions & 0 deletions src/polling.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,9 @@ module.exports = {
case 'c.1.wb.shift.bgain':
self.data.bGainValue = str[1];
break;
case 'c.1.platform.status':
self.data.platformStatus = str[1];
break;
case 'p':
self.data.presetLastUsed = parseInt(str[1]);
self.checkVariables()
Expand Down

0 comments on commit e0dcf54

Please sign in to comment.