Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: ph_extendmacrowait Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Dean
Senior Member
Senior Member
Avatar

Joined: August 21 2003
Location: United States
Online Status: Offline
Posts: 109
Posted: January 05 2005 at 21:25 | IP Logged Quote Dean

When using the ph_extendmacrowait command, is this an additive function, meaning if the macro is already in a wait state, whatever time is passed in the extendmacrowait command is added to that time? Or, if a macro is waiting whatever value is passed in the extendmacrowait command becomes the new wait time?

For example, a motion sensor triggers a macro to turn on a light. The macro turns on the light, waits for 180 seconds and then turns the light off. If the motion sensor triggers again within that 180 seconds, a check is made to see if the macro is waiting. In this example, it is waiting, so does the time in the extendmacrowait command (say 180 seconds) get added to the currently waiting time (which could push the wait time past the initial 180 seconds) or does it become the new wait time?

Thanks,

-Dean
Back to Top View Dean's Profile Search for other posts by Dean
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: January 05 2005 at 22:10 | IP Logged Quote TonyNo

From the docs...

ph_extendmacrowait PowerHome formula function

Description
Extends the amount of wait time for a macro which is currently in a wait state.

Syntax
ph_extendmacrowait ( s, n, n )

Argument Description
s String representing the ID of the waiting macro.
n Double representing the number of seconds to extend the wait. Fractions of a second can be represented in decimal format.
n Integer representing the method of extending the wait.

A 0 will extend the macros wait time from the time this function is executed. Any other value will extend the wait from the time the macro is currently set to expire.


I would take that as a 0 will make it expire n seconds after this executes.
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: January 05 2005 at 22:18 | IP Logged Quote TonyNo

I just ran a test to check, and my take was correct.
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum