From 543802e520935403f48b20982ba4361e1da2f3b6 Mon Sep 17 00:00:00 2001 From: jghaanstra Date: Tue, 5 Jun 2018 18:48:54 +0200 Subject: [PATCH] Release 2.6.5 --- APPSTORE.md | 4 ++- drivers/philips-bulb/driver.js | 55 +++++++++++++++++----------------- drivers/yeelights/device.js | 6 ++-- drivers/yeelights/driver.js | 2 +- 4 files changed, 34 insertions(+), 33 deletions(-) diff --git a/APPSTORE.md b/APPSTORE.md index d8db294..a0dcb67 100644 --- a/APPSTORE.md +++ b/APPSTORE.md @@ -24,6 +24,8 @@ 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-06-04 -- v2.6.5 +### 2018-06-05 -- v2.6.5 * NEW: add support for Yeelight Desk Lamp +* FIX: remove color capabilities for regular Yeelight ceiling lamp +* FIX: fix type-o in temperature range for Yeelight ceiling lamp * FIX: fixed issues with color temperature for Xiaomi Philips Light Bulbs diff --git a/drivers/philips-bulb/driver.js b/drivers/philips-bulb/driver.js index ee9edd9..fb5bb11 100644 --- a/drivers/philips-bulb/driver.js +++ b/drivers/philips-bulb/driver.js @@ -5,36 +5,35 @@ const miio = require('miio'); class PhilipsBulbDriver extends Homey.Driver { - onPair(socket) { - socket.on('testConnection', function(data, callback) { - miio.device({ - address: data.address, - token: data.token - }).then(device => { - const getData = async () => { - try { - const power = await device.power(); - const brightness = await device.brightness() - const colorTemperature = await device.color(); + onPair(socket) { + socket.on('testConnection', function(data, callback) { + miio.device({ + address: data.address, + token: data.token + }).then(device => { + const getData = async () => { + try { + const power = await device.power(); + const brightness = await device.brightness(); + const colorTemperature = await device.color(); - let result = { - onoff: power, - brightness: brightness, - colorTemperature: colorTemperature - } - - callback(null, result); - } catch (error) { - callback(error, null); - } - } - getData(); - }).catch(function (error) { - callback(error, null); - }); - }); - } + let result = { + onoff: power, + brightness: brightness, + colorTemperature: colorTemperature + } + callback(null, result); + } catch (error) { + callback(error, null); + } + } + getData(); + }).catch(function (error) { + callback(error, null); + }); + }); + } } module.exports = PhilipsBulbDriver; diff --git a/drivers/yeelights/device.js b/drivers/yeelights/device.js index bb75c10..44ed449 100644 --- a/drivers/yeelights/device.js +++ b/drivers/yeelights/device.js @@ -83,7 +83,7 @@ class YeelightDevice extends Homey.Device { if (this.getData().model == 'ceiling4') { var color_temp = yeelight.denormalize(value, 2700, 6000); } else { - var color_temp = yeelight.denormalize(value, 1700, 6500); + var color_temp = yeelight.denormalize(value, 2700, 6500); } this.sendCommand(this.getData().id, '{"id":1,"method":"set_ct_abx","params":['+ color_temp +', "smooth", 500]}'); callback(null, value); @@ -183,7 +183,7 @@ class YeelightDevice extends Homey.Device { if (device.getData().model == 'ceiling4') { var color_temp = yeelight.normalize(result.params.ct, 2700, 6000); } else { - var color_temp = yeelight.normalize(result.params.ct, 1700, 6500); + var color_temp = yeelight.normalize(result.params.ct, 2700, 6500); } device.setCapabilityValue('light_temperature', color_temp); break; @@ -229,7 +229,7 @@ class YeelightDevice extends Homey.Device { if (device.getData().model == 'ceiling4') { var color_temp = yeelight.normalize(result.result[3], 2700, 6000); } else { - var color_temp = yeelight.normalize(result.result[3], 1700, 6500); + var color_temp = yeelight.normalize(result.result[3], 2700, 6500); } if(result.result[2] == 2) { var color_mode = 'temperature'; diff --git a/drivers/yeelights/driver.js b/drivers/yeelights/driver.js index cd3e391..4303ba6 100644 --- a/drivers/yeelights/driver.js +++ b/drivers/yeelights/driver.js @@ -8,7 +8,7 @@ const typeCapabilityMap = { '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' ], + 'ceiling' : [ 'onoff', 'dim', 'light_temperature', 'light_mode' ], 'ceiling4' : [ 'onoff', 'dim', 'light_hue', 'light_saturation', 'light_temperature', 'light_mode' ], 'desklamp' : [ 'onoff', 'dim', 'light_temperature', 'light_mode' ] }