Foddy / node-red-contrib-huemagic

Philips Hue node to control bridges, lights, groups, motion sensors, temperature sensors and Lux sensors using Node-RED.
https://flows.nodered.org/node/node-red-contrib-huemagic
Apache License 2.0
201 stars 68 forks source link

msg.topic is always 0 #245

Closed stefan90403 closed 2 years ago

stefan90403 commented 3 years ago

Describe the bug when i use msg.topic in universal mode to set the group id, the group id is always set to 0

Expected behavior msg.topic should set the group id

Additional context

In my opinion, the Problem is in this line:

var tempGroupID = (msg.topic != null && isNaN(msg.topic) == false && msg.topic.length > 0) ? parseInt(msg.topic) : config.groupid;

msg.topic is an integer and has no length. when i use it like that:

var tempGroupID = (msg.topic != null && isNaN(msg.topic) == false ) ? parseInt(msg.topic) : config.groupid;

it works for me.

Foddy commented 2 years ago

Fixed with v4