diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fffcd3..25062b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ You can also use the [PACKAGES](https://github.com/oznu/docker-homebridge#option All notable changes to this project will be documented in this file. +## 1.3.7 + +- [FIX] potential fix for #37 (multiple deebots) + ## 1.3.6 - [FIX] potential fix for #37 (multiple deebots) diff --git a/deebotEcovacsAPI.js b/deebotEcovacsAPI.js index 83218ca..85fb1be 100644 --- a/deebotEcovacsAPI.js +++ b/deebotEcovacsAPI.js @@ -11,6 +11,8 @@ module.exports = { }; function DeebotEcovacsAPI(log, platform) { + EventEmitter.call(this); + this.log = log; this.platform = platform; this.login = platform.login; @@ -48,6 +50,7 @@ DeebotEcovacsAPI.prototype = { ); this.vacbots.push(vacbot); } + this.emit('deebotsDiscovered'); }); }) @@ -62,8 +65,8 @@ DeebotEcovacsAPI.prototype = { configureEvents: function (deebotAccessory) { var Characteristic = this.platform.api.hap.Characteristic; - var vacBot = deebotAccessory.vacBot; - EventEmitter.call(vacBot); + let vacBot = deebotAccessory.vacBot; + vacBot.on('ready', (event) => { this.log.debug('INFO - Vacbot ' + deebotAccessory.name + ' ready: ' + JSON.stringify(event)); diff --git a/package.json b/package.json index 5c1d41d..0b6ca2e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homebridge-deebotecovacs", - "version": "1.3.6", + "version": "1.3.7", "author": "Nicolas Dujardin", "description": "Publish your deebot ecovacs as an homekit accessory", "main": "index.js",