From 08ef90f7b04910e27f750561bdac5cce6dba84e7 Mon Sep 17 00:00:00 2001 From: naofireblade Date: Tue, 6 Jun 2017 17:25:02 +0200 Subject: [PATCH] Version 0.4.1 * Added config parameter for extraCareNavigation --- CHANGELOG.md | 6 +++++- README.md | 28 +++++++++++++++++++++++----- index.js | 8 ++++++-- package.json | 2 +- 4 files changed, 35 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f3f6f0..b52eae4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,4 +37,8 @@ * Added support for multiple robots * Added log output when user requests accessory identify * Changed plugin to platform instead of single accessory -* Removed parameter name from config \ No newline at end of file +* Removed parameter name from config + +## 0.4.1 + +* Added config parameter for extraCareNavigation \ No newline at end of file diff --git a/README.md b/README.md index 42360b3..ebf38e0 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This is a plugin for [homebridge](https://github.com/nfarina/homebridge) to cont Feel free to leave any feedback [here](https://github.com/naofireblade/homebridge-neato/issues). -If you update from a previous version you have to adapt your config. +If you update from a previous version 0.3.x you have to adapt your config. # Features @@ -16,11 +16,10 @@ If you update from a previous version you have to adapt your config. - Get dock info - Periodic refresh of robot state - Support for multiple robots +- Extra care navigation \* 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. - # Installation 1. Install homebridge using: `npm install -g homebridge` @@ -32,7 +31,25 @@ If you update from a previous version you have to adapt your config. Add the following information to your config file. Change the values for name, email and password. -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). +#### Simple + +```json +"platforms": [ + { + "platform": "NeatoVacuumRobot", + "email": "YourEmail", + "password": "YourPassword" + } +] +``` + +The following config contains optional settings that are disabled when not specified. + +The parameter **refresh** 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). + +The parameter **extraCareNavigation** determines if supporting models (currently Neato D3 and D5) take extra care of your furniture while cleaning. + +#### Advanced ```json "platforms": [ @@ -40,7 +57,8 @@ The parameter **refresh** is optional (default 0=off) and adjusts in what interv "platform": "NeatoVacuumRobot", "email": "YourEmail", "password": "YourPassword", - "refresh": "0" + "refresh": "120", + "extraCareNavigation": true } ] ``` diff --git a/index.js b/index.js index f0f3ae1..155dcbe 100644 --- a/index.js +++ b/index.js @@ -18,6 +18,9 @@ function NeatoVacuumRobotPlatform(log, config) { this.email = config['email']; this.password = config['password']; + this.careNavigation = ('extraCareNavigation' in config && config['extraCareNavigation'] ? 2 : 1); + debug("Extra Care Navigation: " + this.careNavigation); + // default off this.refresh = ('refresh' in config ? parseInt(config['refresh']) : 0); // must be integer and positive @@ -78,6 +81,7 @@ function NeatoVacuumRobotAccessory(robot, platform) { this.platform = platform; this.log = platform.log; this.refresh = platform.refresh; + this.careNavigation = platform.careNavigation; this.robot = robot; this.name = robot.name; this.lastUpdate = null; @@ -155,8 +159,8 @@ NeatoVacuumRobotAccessory.prototype = { that.robot.resumeCleaning(callback); } else { - debug(that.name + ": Start cleaning"); - that.robot.startCleaning(that.robot.eco, 2, callback); + debug(that.name + ": Start cleaning (" + that.careNavigation + ")"); + that.robot.startCleaning(that.robot.eco, that.careNavigation, callback); } } else { diff --git a/package.json b/package.json index 4afbca8..c09e6ed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homebridge-neato", - "version": "0.4.0", + "version": "0.4.1", "description": "A Neato vacuum robot plugin for homebridge.", "license": "MIT", "keywords": [