Skip to content

Commit

Permalink
Release 2.11.4
Browse files Browse the repository at this point in the history
  • Loading branch information
jghaanstra committed Mar 3, 2019
1 parent 2aa1ce8 commit aaa2486
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/yeelight.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ exports.listenUpdates = function () {

advertisements.on('message', (message, address) => {
process.nextTick(function() {
var yeelights = Homey.ManagerDrivers.getDriver('yeelights').getDevices();


parseMessage(message)
.then(result => {
if (result !== 'no devices') {
Expand All @@ -60,6 +60,7 @@ exports.listenUpdates = function () {
console.log('result.message_type: ', result.message_type);
}

var yeelights = Homey.ManagerDrivers.getDriver('yeelights').getDevices();
Object.keys(yeelights).forEach(function(key) {
// update ip for changed ip's
if (result.message_type != 'discover' && yeelights[key].getData().id == result.device.id && (yeelights[key].getSetting('address') != result.device.address || yeelights[key].getSetting('port') != result.device.port) ) {
Expand Down

0 comments on commit aaa2486

Please sign in to comment.