HomeGenie Forum

General Category => General Discussion => Topic started by: Deggle on April 28, 2016, 08:34:53 PM

Title: Call a Program and Pass an Argument
Post by: Deggle on April 28, 2016, 08:34:53 PM
Hi,

Hopefully just a quick one...

Taking the included sunrise scene program as an example, I can start this by requesting:

.../api/HomeAutomation.HomeGenie/Automation/Programs.Run/8

What I'd like to do is pass an argument - for this example, perhaps a duration that the scene should last, say

.../api/HomeAutomation.HomeGenie/Automation/Programs.Run/8/3600

Is this possible, and if so how do I access the argument in the C#?

Many thanks,

Tim
Title: Re: Call a Program and Pass an Argument
Post by: Gene on April 28, 2016, 08:54:05 PM
Use the special string variable PROGRAM_OPTIONS_STRING  to read the passed argument value.
Title: Re: Call a Program and Pass an Argument
Post by: Deggle on April 28, 2016, 09:01:31 PM
Brilliant, thanks!

T