From e0dcf5466ccf49007732677edffaffb517900d00 Mon Sep 17 00:00:00 2001 From: Joseph Adams Date: Thu, 14 Mar 2024 13:35:59 -0400 Subject: [PATCH] add initialization feedback --- src/feedbacks.js | 33 +++++++++++++++++++++++++++++++++ src/index.js | 1 + src/polling.js | 3 +++ 3 files changed, 37 insertions(+) diff --git a/src/feedbacks.js b/src/feedbacks.js index 4ffaffd..cacec04 100644 --- a/src/feedbacks.js +++ b/src/feedbacks.js @@ -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); diff --git a/src/index.js b/src/index.js index bc886fe..0078b4b 100644 --- a/src/index.js +++ b/src/index.js @@ -85,6 +85,7 @@ class canonptzInstance extends InstanceBase { imageStabilization: '', firmwareVersion: '', protocolVersion: '', + platformStatus: '', //Zoom/Focus zoomSpeed: 8, diff --git a/src/polling.js b/src/polling.js index acf4f65..8a5f142 100644 --- a/src/polling.js +++ b/src/polling.js @@ -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()