From 0913dfca0a640a004b5f1fddc8205ed2ad8aaa20 Mon Sep 17 00:00:00 2001 From: Andreas Holstenson Date: Sat, 17 Feb 2018 09:30:21 +0100 Subject: [PATCH] Vacuum now refreshes properties after actions --- lib/devices/vacuum.js | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/lib/devices/vacuum.js b/lib/devices/vacuum.js index 0a04a38..805bd8c 100644 --- a/lib/devices/vacuum.js +++ b/lib/devices/vacuum.js @@ -162,7 +162,10 @@ module.exports = class extends Vacuum.with( * Start a cleaning session. */ activateCleaning() { - return this.call('app_start', []) + return this.call('app_start', [], { + refresh: [ 'state' ], + refreshDelay: 1000 + }) .then(checkResult); } @@ -170,7 +173,9 @@ module.exports = class extends Vacuum.with( * Pause the current cleaning session. */ pause() { - return this.call('app_pause', []) + return this.call('app_pause', [], { + refresh: [ 'state '] + }) .then(checkResult); } @@ -178,7 +183,10 @@ module.exports = class extends Vacuum.with( * Stop the current cleaning session. */ deactivateCleaning() { - return this.call('app_stop', []) + return this.call('app_stop', [], { + refresh: [ 'state' ], + refreshDelay: 1000 + }) .then(checkResult); } @@ -188,7 +196,10 @@ module.exports = class extends Vacuum.with( activateCharging() { return this.call('app_stop', []) .then(checkResult) - .then(() => this.call('app_charge', [])) + .then(() => this.call('app_charge', [], { + refresh: [ 'state' ], + refreshDelay: 1000 + })) .then(checkResult); } @@ -196,7 +207,9 @@ module.exports = class extends Vacuum.with( * Start cleaning the current spot. */ activateSpotClean() { - return this.call('app_spot', []) + return this.call('app_spot', [], { + refresh: [ 'state' ] + }) .then(checkResult); } @@ -205,8 +218,9 @@ module.exports = class extends Vacuum.with( */ changeFanSpeed(speed) { return this.call('set_custom_mode', [ speed ], { - refresh: true - }); + refresh: [ 'fanSpeed' ] + }) + .then(checkResult); } /**