Skip to content

Commit

Permalink
still reporting 0.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoduj committed Mar 24, 2019
1 parent e1296fd commit 5d1dc57
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
3 changes: 2 additions & 1 deletion harmonyAsSwitches.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ HarmonyPlatformAsSwitches.prototype = {
this.refreshService(service, undefined);
}
}
this.harmonyBase.refreshHomeAccessory(this);
},

handleActivityOk: function(commandToSend) {
Expand Down Expand Up @@ -216,7 +217,7 @@ HarmonyPlatformAsSwitches.prototype = {
for (let a = 0; a < homebridgeAccessory.services.length; a++) {
if (homebridgeAccessory.services[a].ActivityId == idToFind) {
service = homebridgeAccessory.services[a];
this.log('INFO - ' + service.displayName + ' activated');
this.log.debug('INFO - ' + service.displayName + ' activated');
break;
}
}
Expand Down
1 change: 1 addition & 0 deletions harmonyAsTVPlatform.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ HarmonyPlatformAsTVPlatform.prototype = {
this.harmonyBase.refreshCurrentActivity(this, () => {
this.handleRefreshOfCharacteristic(this._currentActivity);
});
this.harmonyBase.refreshHomeAccessory(this);
},

refreshCharacteristic: function(characteristic, callback) {
Expand Down
19 changes: 10 additions & 9 deletions harmonyBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,6 @@ HarmonyBase.prototype = {
'INFO - Hub config : ' + JSON.stringify(response)
);
this.getHomeControlsAccessories(harmonyPlatform).then(responseHome => {
//DEBUG

responseHome = JSON.parse(
' {"cmd":"harmony.automation?getstate","code":200,"id":"0.11199321450018873","msg":"OK","data":{"hue-light.harmony_virtual_button_3":{"color":{"mode":"xy","xy":{"y":0,"x":0},"temp":300,"hueSat":{"hue":0,"sat":0}},"brightness":254,"on":true,"status":0},"hue-light.harmony_virtual_button_4":{"color":{"mode":"xy","xy":{"y":0,"x":0},"temp":300,"hueSat":{"hue":0,"sat":0}},"brightness":254,"on":false,"status":0},"hue-light.harmony_virtual_button_1":{"color":{"mode":"xy","xy":{"y":0,"x":0},"temp":300,"hueSat":{"hue":0,"sat":0}},"brightness":254,"on":false,"status":0},"hue-light.harmony_virtual_button_2":{"color":{"mode":"xy","xy":{"y":0,"x":0},"temp":300,"hueSat":{"hue":0,"sat":0}},"brightness":254,"on":false,"status":0}}}'
);

harmonyPlatform.readAccessories(response, responseHome);
this.numberAttemps = 0;
});
Expand Down Expand Up @@ -306,7 +300,7 @@ HarmonyBase.prototype = {
for (let s = 0; s < myHarmonyAccessory.services.length; s++) {
let service = myHarmonyAccessory.services[s];
if (service.type == HOME_TYPE) {
let newValue = data[service.id];
let newValue = data[service.HomeId];

if (newValue) {
let characteristic = service.getCharacteristic(Characteristic.On);
Expand Down Expand Up @@ -395,6 +389,13 @@ HarmonyBase.prototype = {
return this.harmony.getAutomationCommands();
} else {
var responseHome = {};
//DEBUG
/*
responseHome = JSON.parse(
' {"cmd":"harmony.automation?getstate","code":200,"id":"0.11199321450018873","msg":"OK","data":{"hue-light.harmony_virtual_button_3":{"color":{"mode":"xy","xy":{"y":0,"x":0},"temp":300,"hueSat":{"hue":0,"sat":0}},"brightness":254,"on":true,"status":0},"hue-light.harmony_virtual_button_4":{"color":{"mode":"xy","xy":{"y":0,"x":0},"temp":300,"hueSat":{"hue":0,"sat":0}},"brightness":254,"on":false,"status":0},"hue-light.harmony_virtual_button_1":{"color":{"mode":"xy","xy":{"y":0,"x":0},"temp":300,"hueSat":{"hue":0,"sat":0}},"brightness":254,"on":false,"status":0},"hue-light.harmony_virtual_button_2":{"color":{"mode":"xy","xy":{"y":0,"x":0},"temp":300,"hueSat":{"hue":0,"sat":0}},"brightness":254,"on":false,"status":0}}}'
);
*/

return Promise.resolve(responseHome);
}
},
Expand Down Expand Up @@ -834,9 +835,9 @@ HarmonyBase.prototype = {
if (
responseHome &&
responseHome.data &&
responseHome.data[service.controlService.id]
responseHome.data[service.HomeId]
)
newValue = responseHome.data[service.controlService.id].on;
newValue = responseHome.data[service.HomeId].on;

this.handleCharacteristicUpdate(
harmonyPlatform,
Expand Down

0 comments on commit 5d1dc57

Please sign in to comment.