Announcement

Collapse
No announcement yet.

Best way to "wait" in script?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Best way to "wait" in script?

    Hi,

    I need to force my script to wait in between sending IP/Serial commands.
    I was using:

    Threading.Thread.Sleep(delaymS)

    But seemed to get very unpredictable results.
    I then switched to hs.WaitSecs(delaySecs) which seems to work well - but only accepts an integer and 1 sec is just too big a delay (I have about 14 ip/serial commands to send).

    Any suggestions on best practice?
    Thanks.

    #2
    Try the WaitMS function. It's a bit obscure because it is part of the HSPhone application, but I've found it to work reliably.
    Attached Files
    Mike____________________________________________________________ __________________
    HS3 Pro Edition 3.0.0.548, NUC i3

    HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

    Comment


      #3
      Originally posted by skavan View Post
      Hi,

      I need to force my script to wait in between sending IP/Serial commands.
      I was using:

      Threading.Thread.Sleep(delaymS)

      But seemed to get very unpredictable results.
      I then switched to hs.WaitSecs(delaySecs) which seems to work well - but only accepts an integer and 1 sec is just too big a delay (I have about 14 ip/serial commands to send).

      Any suggestions on best practice?
      Thanks.
      The documentation is wrong. You can use hs.waitsecs(0.1) for 100mS
      Jon

      Comment


        #4
        Thanks to the both of you...much appreciated.
        How do the HS people get feedback to correct stuff (like documentation?).

        s.

        Comment


          #5
          Originally posted by skavan View Post
          How do the HS people get feedback to correct stuff (like documentation?).
          Good question. Documentation (accurate or otherwise) does not appear to be a high priority at HST.
          Mike____________________________________________________________ __________________
          HS3 Pro Edition 3.0.0.548, NUC i3

          HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

          Comment


            #6
            Originally posted by skavan View Post
            Thanks to the both of you...much appreciated.
            How do the HS people get feedback to correct stuff (like documentation?).

            s.
            Thankfully by all those nice users that post their findings here as a correction to the many faults in the official documentation.
            - Bram

            Send from my Commodore VIC-20

            Ashai_Rey____________________________________________________________ ________________
            HS3 Pro 3.0.0.534
            PIugins: ZMC audio | ZMC VR | ZMC IR | ZMC NDS | RFXcom | AZ scripts | Jon00 Scripts | BLBackup | FritzBox | Z-Wave | mcsMQTT | AK Ikea

            Comment


              #7
              Originally posted by skavan View Post
              Thanks to the both of you...much appreciated.
              How do the HS people get feedback to correct stuff (like documentation?).

              s.
              The official way is via Bugzilla, however they never bother to address issues there either.
              Jon

              Comment

              Working...
              X