Skip to content

Commit

Permalink
fixing number of commands
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoduj committed May 21, 2020
1 parent 2ad97b8 commit 2037f68
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 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.3.8

- [FIX] numberOfCommands for volume broken - #261

## 1.3.7

- [FIX] change node prerequisite to LTS version (10.20.0 at least)
Expand Down
11 changes: 6 additions & 5 deletions harmonyAsTVKeysTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ module.exports = {
return keysMap;
},

getOverrideCommand: function (platform, command, defaultCommand, defaultNumberToSend = 1) {
getOverrideCommand: function (platform, command, defaultCommand, defaultNumberToSend) {
if (
platform.remoteOverrideCommandsList &&
platform.remoteOverrideCommandsList[platform._currentInputService.activityName] &&
Expand All @@ -127,14 +127,13 @@ module.exports = {
let overrideArray = override.split(';');
let device = overrideArray[0];
let cmd = overrideArray[1];
var numberOfCommands = defaultNumberToSend;
var numberOfCommands = 1;

if (defaultNumberToSend) numberOfCommands = defaultNumberToSend;
if (overrideArray.length > 2) numberOfCommands = overrideArray[2];

let commandToSend = platform.harmonyBase.deviceCommands[[device, cmd]];

platform.log(
'(' + platform.name + ')' + 'INFO - TEST - ' + commandToSend + '-' + numberOfCommands
);
if (commandToSend) {
commandToSend = commandToSend + '|' + numberOfCommands;

Expand Down Expand Up @@ -167,6 +166,8 @@ module.exports = {
}
}

defaultCommand = defaultCommand + '|' + defaultNumberToSend;

return defaultCommand;
},
};
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.3.7",
"version": "1.3.8",
"author": "Nicolas Dujardin",
"description": "Publish your harmony activities as homekit accessories",
"main": "index.js",
Expand Down

0 comments on commit 2037f68

Please sign in to comment.