Skip to content

Commit

Permalink
trying to avoid lib update for the moment
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoduj committed Mar 24, 2019
1 parent 6628bd1 commit d478596
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions harmonyBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,23 @@ HarmonyBase.prototype = {
}
},

_onMessage(message) {
if (message.type === 'automation.state?notify') {
this.harmony.emit('automationState', message);
}
},

configureAccessories: function(harmonyPlatform, callback) {
harmonyPlatform.log('INFO - Loading activities...');

this.harmony.removeAllListeners();

this.harmony.on('open', () => {
harmonyPlatform.log.debug('INFO - socket opened');
//adding listener
this.harmony._client.onUnpackedMessage.addListener(
this._onMessage.bind(this)
);
});

this.harmony.on('close', () => {
Expand Down

0 comments on commit d478596

Please sign in to comment.