fix for setting the colour of the lights
This commit is contained in:
parent
90b5829e1e
commit
07ee9eb4d5
@ -3,6 +3,7 @@ const client = new LifxClient();
|
|||||||
const em = require('events').EventEmitter;
|
const em = require('events').EventEmitter;
|
||||||
const util = require('util');
|
const util = require('util');
|
||||||
const logger = require('log4js').getLogger('Lights');
|
const logger = require('log4js').getLogger('Lights');
|
||||||
|
|
||||||
logger.level = 'debug';
|
logger.level = 'debug';
|
||||||
|
|
||||||
const LightController = function() {
|
const LightController = function() {
|
||||||
@ -80,9 +81,10 @@ const LightController = function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.on('setColour', (data) => {
|
this.on('setColour', (data) => {
|
||||||
const wLight = devices.get(data.id);
|
const wLight = client.devices[data.id];
|
||||||
if (wLight) {
|
if (wLight) {
|
||||||
logger.info('Setting color of ', wLight.label);
|
logger.info('Setting color of ', wLight.label);
|
||||||
|
// logger.debug(wLight);
|
||||||
wLight.color(data.color.hue, data.color.saturation, data.color.brightness, data.color.kelvin);
|
wLight.color(data.color.hue, data.color.saturation, data.color.brightness, data.color.kelvin);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user