Skip to content

Commit

Permalink
1.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoduj committed Apr 16, 2022
1 parent 589bb77 commit 271b1b4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file.

## 1.6.1

- [FIX] Fixing order issue with sortInput set to 3 #375

## 1.6.0

- [FIX] This plugin slows down Homebridge / socket closed messages #387 #380
Expand Down
15 changes: 4 additions & 11 deletions harmonySubPlatform.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,18 +256,11 @@ HarmonySubPlatform.prototype = {

if (this.sortInput == 1) activities.sort((a, b) => a.label.localeCompare(b.label));
else if (this.sortInput == 2) activities.sort((a, b) => a.activityOrder - b.activityOrder);
else if (this.sortInput == 2) activities.sort((a, b) => a.activityOrder - b.activityOrder);
else if (this.sortInput > 2 && this.activitiesToPublishAsInputForTVMode) {
const sorter = (a, b) => {
if (this.activitiesToPublishAsInputForTVMode.includes(a.label)) {
return -1;
}
if (this.activitiesToPublishAsInputForTVMode.includes(b.label)) {
return 1;
}
return 0;
};
activities.sort(sorter);
var refArray = this.activitiesToPublishAsInputForTVMode;
activities.sort(function (a, b) {
return refArray.indexOf(a.label) - refArray.indexOf(b.label);
});
}

for (let i = 0, len = activities.length; i < len; i++) {
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": "homebridge-harmony",
"version": "1.6.0",
"version": "1.6.1",
"author": "Nicolas Dujardin",
"description": "Publish your harmony activities as homekit accessories",
"main": "index.js",
Expand Down

0 comments on commit 271b1b4

Please sign in to comment.