mrgadget/node-red-contrib-eztimer

msg.payload number 0 send as string

bemmbix opened this issue · 6 comments

When sending out a payload in number format data 1 is send correct as number, but 0 is send as String

Hey - sorry, haven't had a chance to look at this yet - seems like it'll be a pretty straight-forward bug. Will hopefully get to it in the next couple of days - the weekend at the latest.

Changed my mind - had a quick look how easy it would be and I think I've solved it with a few lines. Can you try replacing the index.js with the one I've just committed please?

Hey did you have a chance to check this out?

Hey did you have a chance to check this out?

I've checked this and now it's ok. When I request a number I receive the number not string.
I hope this fix will not introduce new bugs. :)

Sorry for the late reply and thanks for your fast fix.
I tested the node and now it sends out zero as number 0. Perfekt!

Thanks for testing @romanstech and @bemmbix. I'm confident it will have zero impact as it's dependent on having selected the numeric option, and I've used parseFloat (rather than parseInt) so decimals etc will still work.