lightingColorCtrl parser support currentX/Y

This commit is contained in:
Koen Kanters
2018-04-25 21:50:41 +02:00
parent 875ca536e0
commit bc1e3d68f9
+16 -1
View File
@@ -135,7 +135,22 @@ const parsers = [
devices: ['LED1545G12', '7146060PH', 'LED1537R6'],
cid: 'lightingColorCtrl',
type: 'devChange',
convert: (msg) => {return {color_temp: msg.data.data['colorTemperature']}},
convert: (msg) => {
const result = {};
if (msg.data.data['colorTemperature']) {
result.color_temp = msg.data.data['colorTemperature'];
}
if (msg.data.data['currentX'] && msg.data.data['currentY']) {
result.color = {
x: msg.data.data['currentX'] / 65535,
y: msg.data.data['currentY'] / 65535,
}
}
return result;
},
},
{
devices: ['WXKG11LM'],