diff --git a/APPSTORE.md b/APPSTORE.md index aa95bed..a348b3e 100644 --- a/APPSTORE.md +++ b/APPSTORE.md @@ -45,6 +45,9 @@ For Homey to be able to communicate with devices over the miIO protocol a unique * Default flow cards for on/off, measure power and meter power capabilities class ## Changelog +### 2018-02-07 -- v2.5.2 +* FIX: removed powerLoad and powerConsumed capability in WiFi plug driver, it's not implemented yet in the miio library v0.15.x + ### 2018-02-04 -- v2.5.1 * UPDATE: updated the miio library to 0.15.5 and rewritten all device drivers * UPDATE: reintroduced support for the Mi Robot Vacuum Cleaner (needs re-pairing the device if coming from an older version) diff --git a/app.json b/app.json index 336b1d6..ea5005d 100644 --- a/app.json +++ b/app.json @@ -9,7 +9,7 @@ "en": [ "Xiaomi", "Mi", "Mi Home", "miio", "vacuumcleaner", "robot", "yeelight", "yeelights", "purifier", "humidifier", "philips", "eyecare", "powerplug" ], "nl": [ "Xiaomi", "Mi", "Mi home", "miio", "stofzuiger", "robot", "yeelight", "yeelights", "luchtreiniger", "luchtbevochtiger", "philips", "eyecare", "powerplug" ] }, - "version": "2.5.1", + "version": "2.5.2", "compatibility": "1.x >=1.5.0", "author": { "name": "Jelger Haanstra", diff --git a/drivers/mi-power-plug/device.js b/drivers/mi-power-plug/device.js index 85d3af6..c915dcc 100644 --- a/drivers/mi-power-plug/device.js +++ b/drivers/mi-power-plug/device.js @@ -44,19 +44,24 @@ class PowerPlugDevice extends Homey.Device { const getData = async () => { try { const power = await this.miio.power(); - const powerConsumed = await this.miio.powerConsumed(); - const powerLoad = await this.miio.powerLoad(); + // TODO: fix powerLoad and powerConsumed: https://github.com/aholstenson/miio/issues/113 + //const powerConsumed = await this.miio.powerConsumed(); + //const powerLoad = await this.miio.powerLoad(); + //const kwh = powerConsumed.wattHours / 1000; - const kwh = powerConsumed.wattHours / 1000; + const kwh = 0; if (this.getCapabilityValue('onoff') != power) { this.setCapabilityValue('onoff', power); } if (this.getCapabilityValue('meter_power') != kwh) { this.setCapabilityValue('meter_power', kwh); - } + }/* if (this.getCapabilityValue('measure_power') != powerLoad.watts) { this.setCapabilityValue('measure_power', powerLoad.watts); + }*/ + if (this.getCapabilityValue('measure_power') != 0) { + this.setCapabilityValue('measure_power', 0); } if (!this.getAvailable()) { this.setAvailable(); diff --git a/drivers/mi-power-plug/driver.js b/drivers/mi-power-plug/driver.js index 8842c42..a22210f 100644 --- a/drivers/mi-power-plug/driver.js +++ b/drivers/mi-power-plug/driver.js @@ -14,15 +14,21 @@ class PowerPlugDriver extends Homey.Driver { const getData = async () => { try { const power = await device.power(); - const powerConsumed = await device.powerConsumed(); - const powerLoad = await device.powerLoad(); + // TODO: fix powerLoad and powerConsumed: https://github.com/aholstenson/miio/issues/113 + //const powerConsumed = await device.powerConsumed(); + //const powerLoad = await device.powerLoad(); + //const kwh = powerConsumed.wattHours / 1000; - const kwh = powerConsumed.wattHours / 1000; - - let result = { + /*let result = { onoff: power, load: powerLoad.watts, consumed: kwh + }*/ + + let result = { + onoff: power, + load: 0, + consumed: 0 } callback(null, result); diff --git a/package.json b/package.json index a136c50..e11091c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.xiaomi-miio", - "version": "2.5.1", + "version": "2.5.2", "description": "Xiaomi Mi Home", "main": "app.js", "dependencies": {