linuxha / node-red-contrib-mytimeout

A dynamic count down timer for node-red
MIT License
10 stars 10 forks source link

First countdown msg is a string ! #17

Closed ipa64 closed 4 years ago

ipa64 commented 5 years ago

Hello, I get a strange behavior, on second output for the countdown the first sent msg is a string then all next are number than expected. Below a debug log, for a timeout of 600s. It’s not a big issue, just the first value are not displayed on the dashboard. Thank you

18.07.2019 à 15:06:13node: MyTimeout msg.payload : string[3] "600" 18.07.2019 à 15:06:13node: MyTimeout msg.payload : number 599 —-> all next output are number format

linuxha commented 5 years ago

I think I know what is doing this. Let me see if I can replicate this first. Do you have some sample code?

ipa64 commented 5 years ago

Yes of course, on the next comment Thank you for you support Have a nice day

Le 19 juil. 2019 à 10:33, Neil Cherry notifications@github.com a écrit :

I think I know what is doing this. Let me see if I can replicate this first. Do you have some sample code?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/linuxha/node-red-contrib-mytimeout/issues/17?email_source=notifications&email_token=ACO7IAL2F2MIBMRQ6IKDO2TQAEYX7A5CNFSM4IEYB5PKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2KPCGY#issuecomment-513077531, or mute the thread https://github.com/notifications/unsubscribe-auth/ACO7IAN33FCLQWLA66IQUN3QAEYX7ANCNFSM4IEYB5PA.

ipa64 commented 5 years ago

a simpler way to test

[{"id":"df7e7f91.a03e88","type":"mytimeout","z":"96df24ce.ad049","name":"","outtopic":"","outsafe":"on","outwarning":"Warning","outunsafe":"off","warning":"5","timer":"30","debug":false,"ndebug":false,"ignoreCase":false,"repeat":false,"again":false,"x":527,"y":186,"wires":[[],["44a6f85c.461be8"]]},{"id":"eb745f5d.232e8","type":"inject","z":"96df24ce.ad049","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":190,"y":186,"wires":[["7b71d50b.fba024"]]},{"id":"44a6f85c.461be8","type":"debug","z":"96df24ce.ad049","name":"debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":738,"y":192,"wires":[]},{"id":"7b71d50b.fba024","type":"function","z":"96df24ce.ad049","name":"Start","func":"mydelay=5; \nmsg.timeout = \"10\";\nmsg.payload = \"on\";\nreturn msg;","outputs":1,"noerr":0,"x":354,"y":186,"wires":[["df7e7f91.a03e88"]]}]

linuxha commented 4 years ago

I think the above is a different code, I see looping and a gate. I don't have the gate but I'll see what I can figure out.

linuxha commented 4 years ago

I setup my docker node-red dev container and I ran the code. I'm pretty sure I resolved the issue with the first msg containing a string and the rest a number. They should now all contain just numbers.

Let me know what you think and I'll close this.

ipa64 commented 4 years ago

Yes now it's working :-) Thank you for all !

linuxha commented 4 years ago

Thanks, I'll close this issue now.