From acdbea5987e27c6d209e776916f43d947ca77a78 Mon Sep 17 00:00:00 2001 From: jghaanstra Date: Mon, 10 Jul 2017 19:02:15 +0200 Subject: [PATCH] Release 2.1.1 - bug fix for Yeelights --- APPSTORE.md | 3 +++ app.json | 2 +- drivers/yeelight-bulb/driver.js | 6 ++++-- package.json | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/APPSTORE.md b/APPSTORE.md index 23abfdc..9e27dc8 100644 --- a/APPSTORE.md +++ b/APPSTORE.md @@ -44,6 +44,9 @@ Donating is completely optional. [![Donate](https://www.paypalobjects.com/webstatic/en_US/i/btn/png/btn_donate_92x26.png)](https://paypal.me/jghaanstra) ## Changelog +### 2017-07-10 -- v2.1.1 +* FIX: fixed app crashing due to error in connection with Yeelight (which could be the case then the Yeelight is unplugged) + ### 2017-06-27 -- v2.1.0 This update requires you to re-pair the Yeelights, Air Purifier and Humidifier. * NEW: changed from miio protocol to direct API for Yeelights, now using auto discovery and hue and saturation are working diff --git a/app.json b/app.json index 31b07a8..69f0cda 100644 --- a/app.json +++ b/app.json @@ -8,7 +8,7 @@ "en": [ "Xiaomi", "Mi", "Mi Home", "vacuumcleaner", "robot", "yeelight", "yeelights", "purifier", "humidifier" ], "nl": [ "Xiaomi", "Mi", "Mi home", "stofzuiger", "robot", "yeelight", "yeelights", "luchtreiniger", "luchtbevochtiger" ] }, - "version": "2.1.0", + "version": "2.1.1", "compatibility": "0.x || 1.x", "author": { "name": "Jelger Haanstra", diff --git a/drivers/yeelight-bulb/driver.js b/drivers/yeelight-bulb/driver.js index 043fa3f..d235bed 100644 --- a/drivers/yeelight-bulb/driver.js +++ b/drivers/yeelight-bulb/driver.js @@ -226,10 +226,12 @@ function createDeviceSocket(device_data) { }); device.socket.on('error', function(error) { - device.socket.destroy(); + module.exports.setUnavailable(device_data, __('unreachable')); + }); + + device.socket.on('close', function(error) { device.socket = null; device.state.connected = false; - module.exports.setUnavailable(device_data, __('unreachable')); }); process.nextTick(function() { diff --git a/package.json b/package.json index 4bc1212..cd0e154 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.xiaomi-miio", - "version": "2.1.0", + "version": "2.1.1", "description": "Xiaomi Mi Home", "main": "app.js", "dependencies": {