Skip to content

Commit

Permalink
merging with 0.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoduj committed Mar 24, 2019
1 parent d333c16 commit e1296fd
Show file tree
Hide file tree
Showing 8 changed files with 266 additions and 59 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ All notable changes to this project will be documented in this file.
- [BREAKING] skipedIfSameStateActivities -> skippedIfSameStateActivities / addAllActivitiesToSkipedIfSameStateActivitiesList -> addAllActivitiesToSkippedIfSameStateActivitiesList
- [BREAKING] MENU command (inside properties of TV Service) renamed to SETUP and will be mapped to setup function if avaliable (can be ovewridden)

## 0.6.1

- [NEW] swithcing to @lopelex 1.0.9

## 0.6.0

- [NEW] support for Exposing Home Control buttons #67
- [BUG] ReferenceError #110

## 0.5.5

- [BUG] - showTurnOffActivity doesn’t work properly when inverterted #107
Expand Down Expand Up @@ -152,7 +161,7 @@ All notable changes to this project will be documented in this file.

## 0.2.3

- [NEW] TV MODE - restoring `SkippedIfSameStateActivities` options #46
- [NEW] TV MODE - restoring `SkipedIfSameStateActivities` options #46

## 0.2.2

Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ Fields:
- `publishDevicesAsIndividualAccessories` option to publish devices as individual accessories. Defaults to true.
- `sequencesToPublishAsAccessoriesSwitch` array of Sequences to exposes through a switch.
- `publishSequencesAsIndividualAccessories` option to publish sequences as individual accessories. Defaults to true.
- `publishHomeControlButtons` set to true if you want to publish home controls as switches
- `publishHomeControlsAsIndividualAccessories` option to publish home controls as individual accessories. Defaults to true.
- `TVPlatformMode` option to try TV mode . STILL WORK IN PROGRESS - NEEDS IOS 12.2 / HOMEBRIDGE 0.0.46
- `mainActivity` set the mainactivity of the TV mode
- `playPauseBehavior` play/pause behavior in TV mode : if set to true, will send pause if played was set and vice-verca. Be aware that both commands must be available, and that it might be out of sync in case of external events (defaults : false - always send play command)
Expand Down Expand Up @@ -196,10 +198,11 @@ Thanks to

- [iandday] for the Harmoney WebSocket protocol implementation and understanding of it.
- [lopelex] for his clean plugin.
- every tester / contributor that test, and give feedback in any way !
- every tester / contributor that test, and give feedback in any way , and especially [gitgayhub] for Home controls in 0.6.0

[lopelex]: https://github.com/lopelex/harmony-websocket
[iandday]: https://github.com/iandday/pyharmony/blob/126e4d5042883f5f718e97d30de67083deedcea0/pyharmony/client.py
[gitgayhub]: https://github.com/gitgayhub

## Donating

Expand Down
23 changes: 9 additions & 14 deletions harmonyAsSwitches.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ HarmonyPlatformAsSwitches.prototype = {
return activity.id != -1 || this.showTurnOffActivity;
},

readAccessories: function(data) {
readAccessories: function(data, homedata) {
let activities = data.data.activity;

let accessoriesToAdd = [];
Expand Down Expand Up @@ -82,7 +82,12 @@ HarmonyPlatformAsSwitches.prototype = {
}
}

this.harmonyBase.setupFoundAccessories(this, accessoriesToAdd, data);
this.harmonyBase.setupFoundAccessories(
this,
accessoriesToAdd,
data,
homedata
);
},

//Cache call method
Expand Down Expand Up @@ -173,16 +178,6 @@ HarmonyPlatformAsSwitches.prototype = {
}
},

isActivityOk: function(data) {
return (
data && data.code && data.code == 200 && data.msg && data.msg == 'OK'
);
},

isActivityInProgress: function(data) {
return data && (data.code == 202 || data.code == 100);
},

handleActivityOk: function(commandToSend) {
this._currentSetAttemps = 0;

Expand Down Expand Up @@ -262,9 +257,9 @@ HarmonyPlatformAsSwitches.prototype = {
'INFO - activityCommand : Returned from hub ' + JSON.stringify(data)
);

if (this.isActivityOk(data)) {
if (HarmonyTools.isCommandOk(data)) {
this.handleActivityOk(commandToSend);
} else if (this.isActivityInProgress(data)) {
} else if (HarmonyTools.isCommandInProgress(data)) {
this.log.debug(
'WARNING - activityCommand : could not SET status : ' +
JSON.stringify(data)
Expand Down
17 changes: 8 additions & 9 deletions harmonyAsTVPlatform.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ HarmonyPlatformAsTVPlatform.prototype = {
return inputSourceService;
},

readAccessories: function(data) {
readAccessories: function(data, homedata) {
let activities = data.data.activity;

let accessoriesToAdd = [];
Expand Down Expand Up @@ -253,7 +253,12 @@ HarmonyPlatformAsTVPlatform.prototype = {

this.bindCharacteristicEventsForInputs(myHarmonyAccessory);

this.harmonyBase.setupFoundAccessories(this, accessoriesToAdd, data);
this.harmonyBase.setupFoundAccessories(
this,
accessoriesToAdd,
data,
homedata
);
},

//Cache call method
Expand Down Expand Up @@ -414,13 +419,7 @@ HarmonyPlatformAsTVPlatform.prototype = {

activityCommand: function(homebridgeAccessory, commandToSend) {
this.harmonyBase.harmony.startActivity(commandToSend).then(data => {
if (
data &&
data.code &&
data.code == 200 &&
data.msg &&
data.msg == 'OK'
) {
if (HarmonyTools.isCommandOk(data)) {
this._currentSetAttemps = 0;

this.log.debug('INFO - activityCommand : command sent');
Expand Down
Loading

0 comments on commit e1296fd

Please sign in to comment.