Skip to content

Commit

Permalink
Release 2.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jghaanstra committed Feb 7, 2018
1 parent 92c00a0 commit 033d55f
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 11 deletions.
3 changes: 3 additions & 0 deletions APPSTORE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
13 changes: 9 additions & 4 deletions drivers/mi-power-plug/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
16 changes: 11 additions & 5 deletions drivers/mi-power-plug/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.xiaomi-miio",
"version": "2.5.1",
"version": "2.5.2",
"description": "Xiaomi Mi Home",
"main": "app.js",
"dependencies": {
Expand Down

0 comments on commit 033d55f

Please sign in to comment.