Skip to content

Commit

Permalink
1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoduj committed Nov 15, 2020
1 parent e588b11 commit 8ae7bca
Show file tree
Hide file tree
Showing 6 changed files with 269 additions and 250 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.4.1

- [NEW] Reverting the one deebot per platform limit, since it won't be supported by homebridge in the futur to have multiple platform of the same plugin. Keeping a property to expose only some deebots (by defautl will try all).

## 1.4.0

- [NEW] specify the deebotname to make it works with multiple deebots. You will need to have one instance of the plugin per deebot. #37 #40
Expand Down
9 changes: 6 additions & 3 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,13 @@
}
]
},
"deebotName": {
"deebotNames": {
"title": "Name of the deebot to publish",
"type": "string",
"description": "In case of multiple ones, you will need to use this in order to specify which one you want. Defaults to first one on your account."
"type": "array",
"items": {
"title": "NickName of the deebot you want to add. ",
"type": "string"
}
},
"refreshTimer": {
"title": "Refresh timer",
Expand Down
13 changes: 7 additions & 6 deletions deebotEcovacsAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ function DeebotEcovacsAPI(log, platform) {
this.device_id = EcoVacsAPI.md5(nodeMachineId.machineIdSync());
this.password_hash = EcoVacsAPI.md5(platform.password);
this.continent = countries[this.countryCode].continent.toUpperCase();
this.deebotName = platform.deebotName;
this.deebotNames = platform.deebotNames;

this.log('INFO - API :' + this.continent + '/' + this.countryCode);

this.api = new EcoVacsAPI(this.device_id, this.countryCode, this.continent);

this.vacbots = [];
}

DeebotEcovacsAPI.prototype = {
Expand All @@ -41,9 +43,9 @@ DeebotEcovacsAPI.prototype = {
let foundDeebotName = vacuum.nick ? vacuum.nick : vacuum.name;

if (
this.deebotName == undefined ||
this.deebotName == '' ||
this.deebotName === foundDeebotName
this.deebotNames == undefined ||
this.deebotNames.length == 0 ||
this.deebotNames.includes(foundDeebotName)
) {
const vacbot = this.api.getVacBot(
this.api.uid,
Expand All @@ -53,8 +55,7 @@ DeebotEcovacsAPI.prototype = {
vacuum,
this.continent
);
this.vacbot = vacbot;
break;
this.vacbots.push(vacbot);
}
}

Expand Down
Loading

0 comments on commit 8ae7bca

Please sign in to comment.