Skip to content

Commit

Permalink
Release 2.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
jghaanstra committed Apr 6, 2018
1 parent 3b0d693 commit 5af9259
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 47 deletions.
45 changes: 4 additions & 41 deletions APPSTORE.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,45 +23,8 @@ This Homey app supports direct control for Yeelights. Before being able to add y
## Adding miIO devices
For Homey to be able to communicate with devices over the miIO protocol a unique device token needs to be obtained. Technical knowledge is needed for retrieving these tokens. If your are not to tech-savvy using this app for any other devices than the Yeelights might be challenging. See the instructions [here](https://github.com/jghaanstra/com.xiaomi-miio/blob/master/docs/obtain_token.md) on retrieving device tokens.

## Supported Cards
### Yeelights
* Default flow cards for light capabilities class
* [ACTIONS] Change brightness over time, Temperature/brightness scene, Color/brightness scene, Custom command (advanced), Set default on state

### Xiaomi Philips Light Bulbs
* Default flow cards for light capabilities class

### Xiaomi Mi Robot Vacuumcleaner
* Default flow cards for vacuumcleaner_state capabilities class
* [ACTIONS] Find the robot, Set fanspeed

### Xiaomi Mi Air Purifiers
* [CONDITIONS] Powered
* [ACTIONS] Power on/off, Set speed

### Xiaomi Mi Humidifiers
* [CONDITIONS] Powered
* [ACTIONS] Power on/off, Set speed

### Xiaomi Single Power Plug
* Default flow cards for on/off, measure power and meter power capabilities class

## Changelog
### 2018-03-15 -- v2.6.2
* NEW: add support for the Xiaomi Gateway Light - alarm not supported yet and subdevices are supported directly with the Xiaomi ZigBee app
* FIX: fix for pairing wizard Philips Light Bulbs
* FIX: small fix in Yeelights driver

### 2018-03-04 -- v2.6.1
* CHANGE: updated device class of Mi Power Plug and Mi Power Strip to "socket" (this require re-pairing of these devices)
* FIX: solved small device naming issue in pair wizard

### 2018-02-18 -- v2.6.0
* NEW: add support for PM2.5 sensor
* NEW: add basic support for WiFi power strips (power load and power consumed are not available for now)
* UPDATE: update miio library to 0.15.6 which fixes:
* Power and color temperature setting fixed for Philips Light Bulbs
* Refreshing of vacuumcleaner state after starting and stopping cleaning
* FIX: update vacuumcleaner state directly when using onoff capability
* FIX: fix flow cards not showing (un)succesful execution status
* FIX: possible fix for showing temperature for purifiers and humidifiers
### 2018-04-06 -- v2.6.3
* UPDATE: changed device class from Xiaomi Gateway to light (repair if you want to use the light flow cards)
* NEW: added trigger card for changes in luminance for Xiaomi Gateway
* FIX: fixed an error with setting the light temperature for the Philips Bulbs
35 changes: 33 additions & 2 deletions 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", "gateway" ],
"nl": [ "Xiaomi", "Mi", "Mi home", "miio", "stofzuiger", "robot", "yeelight", "yeelights", "luchtreiniger", "luchtbevochtiger", "philips", "eyecare", "powerplug", "gateway" ]
},
"version": "2.6.2",
"version": "2.6.3",
"compatibility": "1.x >=1.5.0",
"author": {
"name": "Jelger Haanstra",
Expand Down Expand Up @@ -674,7 +674,7 @@
"large": "drivers/gateway/assets/images/large.jpg",
"small": "drivers/gateway/assets/images/small.jpg"
},
"class": "other",
"class": "light",
"capabilities": [
"onoff",
"dim",
Expand Down Expand Up @@ -752,6 +752,37 @@
}
],
"flow": {
"triggers": [
{
"id": "gatewayLuminance",
"title": {
"en": "Luminance has changed",
"nl": "De helderheid is veranderd"
},
"tokens": [
{
"name": "luminance",
"type": "number",
"title": {
"en": "luminance",
"nl": "helderheid"
},
"example": 0
}
],
"args": [
{
"name": "device",
"type": "device",
"placeholder": {
"en": "Select Gateway",
"nl": "Selecteer Gateway"
},
"filter": "driver_id=gateway"
}
]
}
],
"conditions": [
{
"id": "poweredAirpurifier",
Expand Down
8 changes: 6 additions & 2 deletions drivers/gateway/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const tinycolor = require("tinycolor2");
class GatewayDevice extends Homey.Device {

onInit() {
new Homey.FlowCardTriggerDevice('gatewayLuminance').register();

this.createDevice();

this.registerCapabilityListener('onoff', this.onCapabilityOnoff.bind(this));
Expand Down Expand Up @@ -65,9 +67,11 @@ class GatewayDevice extends Homey.Device {
this.miio = miiodevice;
this.miio.light = miiodevice.child('light');

miiodevice.on('illuminanceChanged', illuminance => {
this.miio.on('illuminanceChanged', illuminance => {
console.log(illuminance);
if (this.getCapabilityValue('measure_luminance') != illuminance.value) {
this.setCapabilityValue('measure_luminance', illuminance.value);
Homey.ManagerFlow.getCard('trigger', 'gatewayLuminance').trigger(this, {luminance: illuminance.value}, {})
}
});

Expand Down Expand Up @@ -100,7 +104,7 @@ class GatewayDevice extends Homey.Device {
const getData = async () => {
try {
const power = await this.miio.light.power();
const brightness = await this.miio.light.brightness()
const brightness = await this.miio.light.brightness();

if (this.getCapabilityValue('onoff') != power) {
this.setCapabilityValue('onoff', power);
Expand Down
2 changes: 1 addition & 1 deletion drivers/philips-bulb/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class PhilipsBulbDevice extends Homey.Device {
onCapabilityLightTemperature(value, opts, callback) {
var colorvalue = util.denormalize(value, 3000, 5700);
var colortemp = ''+ colorvalue +'K';
device.color(colortemp)
this.miio.color(colortemp)
.then(result => { callback(null, value) })
.catch(error => { callback(error, false) });
}
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.6.2",
"version": "2.6.3",
"description": "Xiaomi Mi Home",
"main": "app.js",
"dependencies": {
Expand Down

0 comments on commit 5af9259

Please sign in to comment.