Skip to content

Commit a64c78b

Browse files
committed
recheck feedbacks after encoder updates
1 parent ad03105 commit a64c78b

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "djsoft-radioboss",
3-
"version": "1.0.8",
3+
"version": "1.0.9",
44
"api_version": "1.0.0",
55
"keywords": [
66
"Radio",

src/polling.js

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@ async function getData(type, cmd) {
198198
try {
199199
let encoderArray = result['Encoders']['Encoder'];
200200
if (isArray(encoderArray)) {
201-
self.log('debug', 'Encoders is an array');
201+
let strEncoders = JSON.stringify(self.STATUS.encoders); //store the existing value as a string for comparison later
202+
202203
self.STATUS.encoders = [];
203204
for (let i = 0; i < encoderArray.length; i++) {
204205
let encoder = encoderArray[i]['$'];
@@ -214,19 +215,15 @@ async function getData(type, cmd) {
214215
encoderObj.label = encoderObj['name'];
215216

216217
self.STATUS.encoders.push(encoderObj);
217-
}
218-
self.updateVariableDefinitions();
219-
}
220-
else {
221-
self.log('debug', 'Encoders is not an array');
222-
self.log('debug', encoderArray);
223-
}
224-
225-
let resultString = JSON.stringify(result);
226-
227-
if (self.lastEncoderContent !== resultString) { //keep it from showing up in the log a million times
228-
self.log('debug', resultString);
229-
self.lastEncoderContent = resultString;
218+
}
219+
220+
if (strEncoders !== JSON.stringify(self.STATUS.encoders)) {
221+
self.updateVariableDefinitions();
222+
self.feedbacks();
223+
}
224+
225+
self.checkVariables();
226+
self.checkFeedbacks();
230227
}
231228
}
232229
catch(error) {

0 commit comments

Comments
 (0)