Beiträge von Reference-Pessimism

VPN/Proxy erkannt

Es scheint, dass Sie einen VPN- oder Proxy-Dienst verwenden. Bitte beachten Sie, dass die Nutzung eines solchen Dienstes die Funktionalität dieser Webseite einschränken kann.

    Hello all -

    I'm having a hell of a time trying to get a Shelly script to work with Timers. I know what I'm after, but it does seem like the asynchronous execution of this JavaScript is biting me. It's a very simple script, but every time I add another timer it seems like the call stack just balloons into infinity and then I "run out of" timers. Basically, my script needs to:

    1. Turn the Shelly on.
    2. Wait two minutes.
    3. Use the HTTP.Get to check if a certain webpage is up, and print to the console the number of reboots, the number of successes (times it got the webpage) and the number of failures (times it failed to load the webpage).
    4. Turn the Shelly off.
    5. Repeat.

    In order to repeat this, I use a five second timer to repeat the process... but I'm obviously ALSO using a timer to delay firing off the HTTP.Get part of the script. How do I solve this? If this were a synchronous script, this would be cake, but... it isn't, and async code is something I'm MUCH less experienced with (and extremely frustrated by, but I'm here to learn!).