Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
56e85c92e0 | ||
|
d6dd94979b | ||
|
6deca89d27 | ||
|
5eb5b9934d | ||
|
9a5c3f942c | ||
|
8f6f3dc72d |
11
CHANGELOG.md
11
CHANGELOG.md
@@ -19,6 +19,15 @@
|
||||
|
||||
* Added periodic refresh of robot state while cleaning
|
||||
* Added optional periodic refresh of robot state while not cleaning
|
||||
* Added error messages when cant login or get robot
|
||||
* Improved go to dock switch to be enabled as soon as possible without manual refresh
|
||||
* Improved switches to indicate the time an action needs to complete
|
||||
* Improved eco mode to not be overwritten by robot state update
|
||||
* Improved eco mode to not be overwritten by robot state update
|
||||
|
||||
## 0.3.1
|
||||
|
||||
* Added support for Neato BotVac D5 Connected
|
||||
|
||||
## 0.3.2
|
||||
|
||||
* Fixed a bug that refresh is not disabled when set to 0
|
@@ -14,7 +14,7 @@ Feel free to leave any feedback [here](https://github.com/naofireblade/homebridg
|
||||
- Get dock info
|
||||
- Periodic refresh of robot state
|
||||
|
||||
\* The robot needs to clean for some seconds before he knows where his dock is. After this time the switch to send him home will be automatically available.
|
||||
\* Available after some seconds of cleaning.
|
||||
|
||||
**Hint:** To control the robot with your own commands just set up a scene with the name of your choice.
|
||||
|
||||
@@ -29,7 +29,7 @@ Feel free to leave any feedback [here](https://github.com/naofireblade/homebridg
|
||||
|
||||
Add the following information to your config file. Change the values for name, email and password.
|
||||
|
||||
The parameter **refresh** is optional (default off) and adjusts in what interval changes in the robot state will be pushed to homekit. The minimum refresh time is 60 seconds. You need this only when you set up rules based on the robot state and start him outside of homekit (e.g. with the Neato app).
|
||||
The parameter **refresh** is optional (default 0=off) and adjusts in what interval (seconds) changes of the robot state will be pushed to homekit. The minimum refresh time is 60 seconds. You need this only when you set up rules based on the robot state and start him outside of homekit (e.g. with the Neato app).
|
||||
|
||||
```json
|
||||
"accessories": [
|
||||
@@ -38,7 +38,7 @@ The parameter **refresh** is optional (default off) and adjusts in what interval
|
||||
"name": "YourRobot",
|
||||
"email": "YourEmail",
|
||||
"password": "YourPassword",
|
||||
"refresh": "120"
|
||||
"refresh": "0"
|
||||
}
|
||||
]
|
||||
```
|
||||
@@ -46,5 +46,6 @@ The parameter **refresh** is optional (default off) and adjusts in what interval
|
||||
# Tested robots
|
||||
|
||||
- BotVac Connected (Firmware 2.2.0)
|
||||
- BotVac D5 Connected
|
||||
|
||||
If you have another connected neato robot, please [tell me](https://github.com/naofireblade/homebridge-neato/issues) about your experience with this plugin.
|
26
index.js
26
index.js
@@ -32,7 +32,7 @@ function NeatoVacuumRobot(log, config) {
|
||||
// must be integer and positive
|
||||
this.refresh = (typeof this.refresh !=='number' || (this.refresh%1)!==0 || this.refresh < 0) ? 0 : this.refresh;
|
||||
// minimum 60s
|
||||
this.refresh = (0 < this.refresh < 60) ? 60 : this.refresh;
|
||||
this.refresh = (this.refresh > 0 && this.refresh < 60) ? 60 : this.refresh;
|
||||
|
||||
this.vacuumRobotCleanService = new Service.Switch(this.name + " Clean", "clean");
|
||||
this.vacuumRobotGoToDockService = new Service.Switch(this.name + " Go to Dock", "goToDock");
|
||||
@@ -97,7 +97,7 @@ NeatoVacuumRobot.prototype = {
|
||||
}
|
||||
else {
|
||||
debug("Start cleaning");
|
||||
that.robot.startCleaning(that.robot.eco, callback);
|
||||
that.robot.startCleaning(that.robot.eco, 2, callback);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -141,6 +141,7 @@ NeatoVacuumRobot.prototype = {
|
||||
callback();
|
||||
}
|
||||
} else {
|
||||
debug(that.robot);
|
||||
callback();
|
||||
}
|
||||
});
|
||||
@@ -186,7 +187,6 @@ NeatoVacuumRobot.prototype = {
|
||||
let that = this;
|
||||
this.getStateAndRobot(function (error, result) {
|
||||
debug("Is docked: " + that.robot.isDocked);
|
||||
debug(that.robot);
|
||||
callback(false, that.robot.isDocked);
|
||||
});
|
||||
},
|
||||
@@ -295,17 +295,29 @@ NeatoVacuumRobot.prototype = {
|
||||
client.authorize(this.email, this.password, false, function (error) {
|
||||
if (error) {
|
||||
that.log(error);
|
||||
that.log.error("Can't log on to neato cloud. Please check your credentials.")
|
||||
}
|
||||
else {
|
||||
client.getRobots(function (error, robots) {
|
||||
if (error) {
|
||||
that.log(error);
|
||||
that.log.error("Successful login but can't connect to your neato robot.")
|
||||
}
|
||||
else {
|
||||
that.robot = robots[0];
|
||||
that.log("Found robot: " + that.robot.name);
|
||||
debug(that.robot);
|
||||
callback();
|
||||
if (robots.length === 0) {
|
||||
that.log.error("Successful login but no robots associated with your account.")
|
||||
}
|
||||
else {
|
||||
that.robot = robots[0];
|
||||
that.log("Found robot: " + that.robot.name);
|
||||
that.getState(function (error, result) {
|
||||
debug(that.robot);
|
||||
})
|
||||
if (robots.length > 1){
|
||||
that.log.warn("Found more then one robot in your account. This plugin currently just supports one. First one found will be used.")
|
||||
}
|
||||
callback();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "homebridge-neato",
|
||||
"version": "0.3.0",
|
||||
"version": "0.3.2",
|
||||
"description": "A Neato vacuum robot plugin for homebridge.",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
@@ -20,7 +20,7 @@
|
||||
"url": "git://github.com/naofireblade/homebridge-neato.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"node-botvac": "^0.1.4",
|
||||
"node-botvac": ">=0.1.5",
|
||||
"debug": "^2.2.0"
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user