linuxha / node-red-contrib-mytimeout

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

Warning sent when setting countdown to low value eg. `3` and warning param to 0 in GUI #26

Closed iRonin closed 4 years ago

linuxha commented 4 years ago

Hi iRonin, are you setting the warning to 0 in the mqtt message (json) or in the mytimeout web config interface? If it's json, do you have a sample json? What other parameters are set/not set? Do you have a sample flow? I'll see how I'm testing this. I think I have a test case for a json warning as 0.

iRonin commented 4 years ago

It seems that it only happens when I set a pretty low value for Countdown, like 3. When I set it to 900 seconds, warning is not fired.

linuxha commented 4 years ago

I can run that through the test suite.

linuxha commented 4 years ago

Here's the results with the set of tests I did:

2019-10-20_21:29:37.1571621377 home/test/base-test-cmdIn {"payload": "on", "timeout": 3, "warning": 0, "extraAttr": "Extra attributes", "TestNo":"Test07" }
2019-10-20_21:29:37.1571621377 home/test/base-test-cmdOut {"topic":"zTopic","payload":"on","qos":0,"retain":false,"_msgid":"5fd4be37.61774","timeout":3,"warning":0,"extraAttr":"Extra attributes","TestNo":"Test07"}
2019-10-20_21:29:38.1571621378 home/test/base-test-ticksOut {"payload":3,"state":1,"flag":"ticks > 0","_msgid":"536ef22f.edf97c"}
2019-10-20_21:29:39.1571621379 home/test/base-test-ticksOut {"payload":2,"state":1,"flag":"ticks > 0","_msgid":"9367ecc1.1181a"}
2019-10-20_21:29:40.1571621380 home/test/base-test-ticksOut {"payload":1,"state":1,"flag":"ticks > 0","_msgid":"c4ab7504.5fd668"}
2019-10-20_21:29:41.1571621381 home/test/base-test-cmdOut {"topic":"zTopic","payload":"off","qos":0,"retain":false,"_msgid":"5fd4be37.61774","timeout":3,"warning":0,"extraAttr":"Extra attributes","TestNo":"Test07"}
2019-10-20_21:29:41.1571621381 home/test/base-test-ticksOut {"payload":0,"state":0,"flag":"off","_msgid":"5fd4be37.61774"}

Do you have an example? Maybe the input json.