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

    HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF, Rain8Net+ | RFXCOM | QSE100D | Vantage Pro | Green-Eye | X10: XTB-232, -IIR | Edgeport/8 | Way2Call | Ecobee3

    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

          HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF, Rain8Net+ | RFXCOM | QSE100D | Vantage Pro | Green-Eye | X10: XTB-232, -IIR | Edgeport/8 | Way2Call | Ecobee3

          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.

            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