IgnitionModuleDevelopmentCommunity / IgnitionNode-RED

Adds support for Node-RED
Apache License 2.0
31 stars 7 forks source link

Can't write 0 to tags #9

Closed kjwilde closed 4 years ago

kjwilde commented 4 years ago

It doesn't appear to allow writing 0 to integer tags or false to Boolean tags. Gives the same error: No tag value supplied

I imagine the offending line is in node-handlers.js:

if(!tagValue){ errorHandling.HandleResponse(RED, this.node, this.config, msg, result, 2, "Invalid tag value", "No tag value supplied"); return; }

iatraviscox commented 4 years ago

The issue is now fixed. That was a mistake. We just want to see if the tagValue is undefined or NULL. I am doing the following instead:

if(typeof tagValue === 'undefined' || tagValue === null)

I have tested it locally and it works as expected. I have updated the nodes to 1.5.7. You should be able to update that in NodeRED.