From 181cef0d8d9086bdad18e6595394f75654f284f7 Mon Sep 17 00:00:00 2001 From: jghaanstra Date: Wed, 5 Sep 2018 17:27:35 +0200 Subject: [PATCH] Release 2.8.2 --- APPSTORE.md | 3 ++- drivers/mi-robot/device.js | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/APPSTORE.md b/APPSTORE.md index 1efc5b6..c2d5156 100644 --- a/APPSTORE.md +++ b/APPSTORE.md @@ -28,7 +28,8 @@ Xiaomi has recently released an update for its v1 vacuum that enabled it for the ## Changelog ### 2018-09-05 - v2.8.2 -* FIX: fixed bug with return to dock action card for Xiaomi Vacuum Cleaner +* FIX: fixed bug with return to dock action card for Vacuum Cleaner +* FIX: fixed where the Vacuum Cleaner always shows as charging even thought the battery is full * UPDATE: removed support for Philips Eyecare since there is a bug in the miio library for this device (see https://github.com/aholstenson/miio/issues/145) ### 2018-08-22 - v2.8.1 diff --git a/drivers/mi-robot/device.js b/drivers/mi-robot/device.js index b6c6e9e..9cdf527 100644 --- a/drivers/mi-robot/device.js +++ b/drivers/mi-robot/device.js @@ -101,10 +101,13 @@ class MiRobotDevice extends Homey.Device { clearInterval(this.pollingInterval); this.pollingInterval = setInterval(() => { - if (this.miio.property('state') == 'charging') { + var battery = this.miio.getState('batteryLevel'); + var fanspeed = this.miio.getState('fanSpeed'); + + if (this.miio.property('state') == 'charging' && battery !== 100) { var onoff = false; var state = 'charging'; - } else if (this.miio.property('state') == 'docking' || this.miio.property('state') == 'full' || this.miio.property('state') == 'returning' || this.miio.property('state') == 'waiting') { + } else if (this.miio.property('state') == 'docking' || this.miio.property('state') == 'full' || this.miio.property('state') == 'returning' || this.miio.property('state') == 'waiting' || this.miio.property('state') == 'charging') { var onoff = false; var state = 'docked'; } else if (this.miio.property('state') == 'cleaning' || this.miio.property('state') == 'zone-cleaning') { @@ -117,8 +120,6 @@ class MiRobotDevice extends Homey.Device { var onoff = false; var state = 'stopped'; } - var battery = this.miio.getState('batteryLevel'); - var fanspeed = this.miio.getState('fanSpeed'); if (this.getCapabilityValue('onoff') != onoff) { this.setCapabilityValue('onoff', onoff);