From 20e0a9b90935ff4a4b776ec998255bf818dc0300 Mon Sep 17 00:00:00 2001 From: naofireblade Date: Mon, 24 Jul 2017 19:52:32 +0200 Subject: [PATCH] Version 0.4.2 * Added config parameter to disable switches/sensors --- CHANGELOG.md | 6 +++++- README.md | 12 ++++++++---- index.js | 15 +++++++++++++-- package.json | 2 +- 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b52eae4..89fef43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,4 +41,8 @@ ## 0.4.1 -* Added config parameter for extraCareNavigation \ No newline at end of file +* Added config parameter for extraCareNavigation + +## 0.4.2 + +* Added config parameter to disable switches/sensors \ No newline at end of file diff --git a/README.md b/README.md index 68ea9d9..a7d4566 100644 --- a/README.md +++ b/README.md @@ -45,11 +45,13 @@ Add the following information to your config file. Change the values for email a ### Advanced -The following config contains advanced settings that are disabled when not specified. +The following config contains advanced optional settings that are off 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 **refresh** sets 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) should take extra care of your furniture while cleaning. +The parameter **extraCareNavigation** sets if supporting models (currently Neato D3 and D5) should take extra care of your furniture while cleaning. + +The parameter **disabled** accepts a list of switches/sensors that can be disabled in the neato homekit plugin (e.g. dock, dockstate, eco, schedule). ```json "platforms": [ @@ -58,7 +60,8 @@ The parameter **extraCareNavigation** determines if supporting models (currently "email": "YourEmail", "password": "YourPassword", "refresh": "120", - "extraCareNavigation": true + "extraCareNavigation": true, + "disabled": ["dock", "dockstate", "eco"] } ] ``` @@ -66,6 +69,7 @@ The parameter **extraCareNavigation** determines if supporting models (currently ## Tested robots - BotVac Connected (Firmware 2.2.0) +- BotVac D3 Connected - 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. diff --git a/index.js b/index.js index 155dcbe..6cc55a6 100644 --- a/index.js +++ b/index.js @@ -17,6 +17,7 @@ function NeatoVacuumRobotPlatform(log, config) { this.serial = "1-3-3-7"; this.email = config['email']; this.password = config['password']; + this.hiddenServices = config['disabled']; this.careNavigation = ('extraCareNavigation' in config && config['extraCareNavigation'] ? 2 : 1); debug("Extra Care Navigation: " + this.careNavigation); @@ -82,6 +83,7 @@ function NeatoVacuumRobotAccessory(robot, platform) { this.log = platform.log; this.refresh = platform.refresh; this.careNavigation = platform.careNavigation; + this.hiddenServices = platform.hiddenServices; this.robot = robot; this.name = robot.name; this.lastUpdate = null; @@ -139,8 +141,17 @@ NeatoVacuumRobotAccessory.prototype = { this.vacuumRobotBatteryService.getCharacteristic(Characteristic.BatteryLevel).on('get', this.getBatteryLevel.bind(this)); this.vacuumRobotBatteryService.getCharacteristic(Characteristic.ChargingState).on('get', this.getBatteryChargingState.bind(this)); - return [this.informationService, this.vacuumRobotCleanService, this.vacuumRobotGoToDockService, this.vacuumRobotDockStateService, this.vacuumRobotEcoService, - this.vacuumRobotScheduleService, this.vacuumRobotBatteryService]; + this.services = [this.informationService, this.vacuumRobotCleanService, this.vacuumRobotBatteryService]; + if (this.hiddenServices.indexOf('dock') === -1) + this.services.push(this.vacuumRobotGoToDockService); + if (this.hiddenServices.indexOf('dockstate') === -1) + this.services.push(this.vacuumRobotDockStateService); + if (this.hiddenServices.indexOf('eco') === -1) + this.services.push(this.vacuumRobotEcoService); + if (this.hiddenServices.indexOf('schedule') === -1) + this.services.push(this.vacuumRobotScheduleService); + + return this.services; }, setClean: function (on, callback) { diff --git a/package.json b/package.json index c09e6ed..de2615c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homebridge-neato", - "version": "0.4.1", + "version": "0.4.2", "description": "A Neato vacuum robot plugin for homebridge.", "license": "MIT", "keywords": [