From af5404692701dec70f7b42f38529fcddfbe595fe Mon Sep 17 00:00:00 2001 From: Arne Date: Mon, 23 Sep 2019 12:12:18 +0200 Subject: [PATCH] Fixed a bug that caused the cleaning of all rooms at once --- accessories/neatoVacuumRobot.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/accessories/neatoVacuumRobot.js b/accessories/neatoVacuumRobot.js index a027c78..da9df69 100644 --- a/accessories/neatoVacuumRobot.js +++ b/accessories/neatoVacuumRobot.js @@ -187,6 +187,7 @@ NeatoVacuumRobotAccessory.prototype = { this.spotCleanAdvancedService.getCharacteristic(SpotRepeatCharacteristic).on('set', this.setSpotRepeat.bind(this)); this.spotCleanAdvancedService.getCharacteristic(SpotRepeatCharacteristic).on('get', this.getSpotRepeat.bind(this)); this.spotCleanAdvancedService.getCharacteristic(SpotWidthCharacteristic).on('set', this.setSpotWidth.bind(this)); + this.spotCleanAdvancedService.getCharacteristic(SpotWidthCharacteristic).on('get', this.getSpotWidth.bind(this)); this.spotCleanAdvancedService.getCharacteristic(SpotHeightCharacteristic).on('set', this.setSpotHeight.bind(this)); this.spotCleanAdvancedService.getCharacteristic(SpotHeightCharacteristic).on('get', this.getSpotHeight.bind(this)); @@ -262,6 +263,7 @@ NeatoVacuumRobotAccessory.prototype = { setClean: function (on, callback, boundary) { + debug(this.name + ": " + (on ? "Enabled " : "Disabled") + " Clean " + boundary); this.platform.updateRobot(this.robot._serial, (error, result) => { // Start @@ -658,7 +660,8 @@ NeatoVacuumRobotAccessory.prototype = { if (!this.boundary) { // only update these values if the state is different from the current one, otherwise we might accidentally start an action - if (this.cleanService.getCharacteristic(Characteristic.On).value !== this.robot.canPause) + // AND dont set a clean switch to on if it's a room switch, otherwise we start the cleaning of each room at once + if (this.cleanService.getCharacteristic(Characteristic.On).value !== this.robot.canPause && (typeof this.boundary === 'undefined')) { this.cleanService.setCharacteristic(Characteristic.On, this.robot.canPause); }