Skip to content

Commit

Permalink
Release 2.6.5
Browse files Browse the repository at this point in the history
  • Loading branch information
jghaanstra committed Jun 4, 2018
1 parent 3f41fc2 commit bf3c26f
Show file tree
Hide file tree
Showing 5 changed files with 145 additions and 46 deletions.
5 changes: 3 additions & 2 deletions APPSTORE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This app uses an unofficial library called the [miIO Device Library](https://git

## Supported devices
Below is a list of supported devices and devices. Post a comment in the [support topic](https://forum.athom.com/discussion/3295/) if you would like to see support for a specific device, some devices might already be supported by the miio library but just need to be implemented. For devices not yet support by the miio library you need technical knowledge to discover the device properties yourself as described [here](https://github.com/aholstenson/miio/blob/master/docs/missing-devices.md).
* Yeelights: Bulbs Wi-Fi (tested), LED strips (tested), Bedside Lamp II (tested), Ceiling Lights (tested)
* Yeelights: Bulbs Wi-Fi (tested), LED strips (tested), Bedside Lamp II (tested), Ceiling Lights (tested), Desk Lamp (tested)
* Xiaomi Philips: Light Bulbs (tested), Eyecare Lamp 2 (untested)
* Xiaomi Robot Vacuum Cleaner V1 (tested) and Xiaomi Robot Vacuum Cleaner V2 (untested)
* Xiaomi Air Purifiers 2, 2S and Pro (tested)
Expand All @@ -24,5 +24,6 @@ This Homey app supports direct control for Yeelights. Before being able to add y
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.

## Changelog
### 2018-05-29 -- v2.6.5
### 2018-06-04 -- v2.6.5
* NEW: add support for Yeelight Desk Lamp
* FIX: fixed issues with color temperature for Xiaomi Philips Light Bulbs
92 changes: 92 additions & 0 deletions drivers/yeelights/assets/desklamp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
92 changes: 48 additions & 44 deletions drivers/yeelights/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,59 +6,63 @@ const yeelight = require('/lib/yeelight.js');
const typeCapabilityMap = {
'mono' : [ 'onoff', 'dim' ],
'color' : [ 'onoff', 'dim', 'light_hue', 'light_saturation', 'light_temperature', 'light_mode' ],
'stripe' : [ 'onoff', 'dim', 'light_hue', 'light_saturation', 'light_temperature', 'light_mode' ],
'bslamp' : [ 'onoff', 'dim', 'light_hue', 'light_saturation', 'light_temperature', 'light_mode' ],
'ceiling' : [ 'onoff', 'dim', 'light_hue', 'light_saturation', 'light_temperature', 'light_mode' ],
'ceiling4' : [ 'onoff', 'dim', 'light_hue', 'light_saturation', 'light_temperature', 'light_mode' ],
'stripe' : [ 'onoff', 'dim', 'light_hue', 'light_saturation', 'light_temperature', 'light_mode' ],
'bslamp' : [ 'onoff', 'dim', 'light_hue', 'light_saturation', 'light_temperature', 'light_mode' ],
'ceiling' : [ 'onoff', 'dim', 'light_hue', 'light_saturation', 'light_temperature', 'light_mode' ],
'ceiling4' : [ 'onoff', 'dim', 'light_hue', 'light_saturation', 'light_temperature', 'light_mode' ],
'desklamp' : [ 'onoff', 'dim', 'light_temperature', 'light_mode' ]
}

const typeIconMap = {
'mono' : 'bulb.svg',
'color' : 'bulb.svg',
'stripe' : 'strip.svg',
'bslamp' : 'bslamp.svg',
'ceiling' : 'ceiling.svg',
'ceiling4': 'ceiling4.svg'
'mono' : 'bulb.svg',
'color' : 'bulb.svg',
'stripe' : 'strip.svg',
'bslamp' : 'bslamp.svg',
'ceiling' : 'ceiling.svg',
'ceiling4' : 'ceiling4.svg',
'desklamp' : 'desklamp.svg'
}

class YeelightDriver extends Homey.Driver {

onInit() {
yeelight.listenUpdates();
}
onInit() {
yeelight.listenUpdates();
}

onPairListDevices (data, callback) {
yeelight.discover()
.then(result => {
let devices = [];
for (let i in result) {
if(result[i].model == 'color') {
var name = Homey.__('yeelight_bulb_color')+ ' (' + result[i].address + ')';
} else if (result[i].model == 'mono') {
var name = Homey.__('yeelight_bulb_white')+ ' (' + result[i].address + ')';
} else if (result[i].model == 'stripe') {
var name = Homey.__('yeelight_led_strip')+ ' (' + result[i].address + ')';
} else if (result[i].model == 'bslamp') {
var name = Homey.__('yeelight_bedside_lamp')+ ' (' + result[i].address + ')';
} else if (result[i].model == 'ceiling' || result[i].model == 'ceiling4') {
var name = Homey.__('yeelight_ceiling_light')+ ' (' + result[i].address + ')';
}
devices.push({
name: name,
data: {
id: result[i].id,
address: result[i].address,
port: result[i].port,
model: result[i].model
},
capabilities: typeCapabilityMap[result[i].model],
icon: typeIconMap[result[i].model]
});
}
callback(null, devices);
});
onPairListDevices (data, callback) {
yeelight.discover()
.then(result => {
let devices = [];
for (let i in result) {
if(result[i].model == 'color') {
var name = Homey.__('yeelight_bulb_color')+ ' (' + result[i].address + ')';
} else if (result[i].model == 'mono') {
var name = Homey.__('yeelight_bulb_white')+ ' (' + result[i].address + ')';
} else if (result[i].model == 'stripe') {
var name = Homey.__('yeelight_led_strip')+ ' (' + result[i].address + ')';
} else if (result[i].model == 'bslamp') {
var name = Homey.__('yeelight_bedside_lamp')+ ' (' + result[i].address + ')';
} else if (result[i].model == 'ceiling' || result[i].model == 'ceiling4') {
var name = Homey.__('yeelight_ceiling_light')+ ' (' + result[i].address + ')';
} else if (result[i].model == 'desklamp') {
var name = Homey.__('yeelight_desklamp')+ ' (' + result[i].address + ')';
}
devices.push({
name: name,
data: {
id: result[i].id,
address: result[i].address,
port: result[i].port,
model: result[i].model
},
capabilities: typeCapabilityMap[result[i].model],
icon: typeIconMap[result[i].model]
});
}
callback(null, devices);
});

}
}

}

Expand Down
1 change: 1 addition & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@
"yeelight_led_stripe": "Yeelight LED Strip",
"yeelight_bedside_lamp": "Yeelight Bedside Lamp",
"yeelight_ceiling_light": "Yeelight Ceiling Light",
"yeelight_desklamp": "Yeelight Desk Lamp",
"unreachable": "Offline"
}
1 change: 1 addition & 0 deletions locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@
"yeelight_led_strip": "Yeelight LED strip",
"yeelight_bedside_lamp": "Yeelight Nachtlamp",
"yeelight_ceiling_light": "Yeelight Plafondlamp",
"yeelight_desklamp": "Yeelight Bureau Lamp",
"unreachable": "Niet beschikbaar"
}

0 comments on commit bf3c26f

Please sign in to comment.