Helper Class Reference
1.1
HomeGenie - Automation Programs' Engine SDK
|
Program Helper class.
Class instance accessor: Program
More...
Inherits ProgramHelperBase.
Public Member Functions | |
void | Setup (Action functionBlock) |
Execute a setup function when the program is enabled. It is meant to be used in the "Startup Code" to execute only once the instructions contained in the passed function. It is mainly used for setting program configuration fields, parameters and features. More... | |
void | Run (bool willRun=true) |
Run the program as soon as the "Startup Code" exits. This command is meant to be used in the "Startup Code". More... | |
ProgramHelper | UseWidget (string widget) |
Set the widget that will be used for displaying this program data in the UI Control page. More... | |
ProgramHelper | AddOption (string field, string defaultValue, string description, string type) |
Adds a configuration option for the program. The option field will be displayed in the program options dialog using the UI widget specified by the "type" field. More... | |
ModuleParameter | Option (string field) |
Gets the value of a program option field. More... | |
ProgramHelper | AddFeature (string forDomains, string forModuleTypes, string parameterName, string description, string type) |
Adds a "feature" field to modules matching the specified domain/type. Feature fields are used by automation programs to create own handled module parameters. This command should only appear inside a Program.Setup delegate. More... | |
ProgramFeature | Feature (string parameterName) |
Return the feature field associated to the specified module parameter. More... | |
ProgramHelper | AddVirtualModule (string domain, string address, string type, string widget) |
Adds a new virtual module to the system. More... | |
ProgramHelper | RemoveVirtualModule (string domain, string address) |
Remove a virtual module from the system. More... | |
ProgramHelper | AddVirtualModules (string domain, string type, string widget, int startAddress, int endAddress) |
Adds a new set of virtual modules to the system. More... | |
ProgramHelper | Notify (string title, string message) |
Display UI notification message from current program. More... | |
ProgramHelper | Notify (string title, string message, params object[] paramList) |
Display UI notification message from current program. More... | |
ProgramHelper | RaiseEvent (string parameter, string value, string description) |
Raise a parameter event and set the parameter with the specified value. More... | |
ProgramHelper | RaiseEvent (ModuleHelper sourceModule, string parameter, string value, string description) |
Raise a module parameter event and set the parameter with the specified value. More... | |
void | GoBackground () |
This command is usually put at the end of the "Program Code". It is the equivalent of an infinite noop loop. More... | |
ModuleParameter | Parameter (string parameterName) |
Gets or sets a program parameter. More... | |
StoreHelper | Store (string storeName) |
Gets or creates a persistent data Store for this program. More... | |
Properties | |
bool | IsRunning [get] |
Gets a value indicating whether the program is running. More... | |
bool | IsEnabled [get] |
Gets a value indicating whether the program is enabled. More... | |
Module | Module [get] |
Get a reference to the Module associated to the program. More... | |
Program Helper class.
Class instance accessor: Program
void Setup | ( | Action | functionBlock | ) |
Execute a setup function when the program is enabled. It is meant to be used in the "Startup Code" to execute only once the instructions contained in the passed function. It is mainly used for setting program configuration fields, parameters and features.
functionBlock | Function name or inline delegate. |
Example:
void Run | ( | bool | willRun = true | ) |
Run the program as soon as the "Startup Code" exits. This command is meant to be used in the "Startup Code".
willRun | If set to true will run. |
ProgramHelper UseWidget | ( | string | widget | ) |
Set the widget that will be used for displaying this program data in the UI Control page.
widget | The widget path. |
ProgramHelper AddOption | ( | string | field, |
string | defaultValue, | ||
string | description, | ||
string | type | ||
) |
Adds a configuration option for the program. The option field will be displayed in the program options dialog using the UI widget specified by the "type" field.
field | Name of this input field |
defaultValue | Default value for this input field |
description | Description for this input field |
type | The type of this option (eg. "text", "password", "cron.text", ...). Each type can have different initialization options that are specified as ":" separated items. See html/ui/widgets folder for a list of possible types/options. |
ModuleParameter Option | ( | string | field | ) |
Gets the value of a program option field.
field | Name of the option field to get. |
Example:
ProgramHelper AddFeature | ( | string | forDomains, |
string | forModuleTypes, | ||
string | parameterName, | ||
string | description, | ||
string | type | ||
) |
Adds a "feature" field to modules matching the specified domain/type. Feature fields are used by automation programs to create own handled module parameters. This command should only appear inside a Program.Setup delegate.
forDomains | A string with comma separated list of domains of modules that will showing this input field. Use an empty string for all domains. |
forModuleTypes | A string with comma separated list of types of modules that will showing this input field. |
parameterName | Name of the module parameter bound to this feature field. |
description | Description for this input field. |
type | The type of this feature field (eg. "text", "password", "cron.text", ...). Each type can have different initialization options that are specified as ":" separated items. See html/ui/widgets folder for a list of possible types/options. |
ProgramFeature Feature | ( | string | parameterName | ) |
Return the feature field associated to the specified module parameter.
propertyName | Parameter name. |
ProgramHelper AddVirtualModule | ( | string | domain, |
string | address, | ||
string | type, | ||
string | widget | ||
) |
Adds a new virtual module to the system.
domain | Domain. |
address | Address. |
type | Type (Generic, Program, Switch, Light, Dimmer, Sensor, Temperature, Siren, Fan, Thermostat, Shutter, DoorWindow, MediaTransmitter, MediaReceiver). |
widget | Empty string or the path of the widget to be associated to the virtual module. |
ProgramHelper RemoveVirtualModule | ( | string | domain, |
string | address | ||
) |
Remove a virtual module from the system.
domain | Domain. |
address | Address. |
ProgramHelper AddVirtualModules | ( | string | domain, |
string | type, | ||
string | widget, | ||
int | startAddress, | ||
int | endAddress | ||
) |
Adds a new set of virtual modules to the system.
domain | Domain. |
type | Type. |
widget | Empty string or the path of the widget to be associated to the virtual module. |
startAddress | Start address (numeric). |
endAddress | End address (numeric). |
ProgramHelper Notify | ( | string | title, |
string | message | ||
) |
Display UI notification message from current program.
title | Title. |
message | Message. |
Example:
ProgramHelper Notify | ( | string | title, |
string | message, | ||
params object[] | paramList | ||
) |
Display UI notification message from current program.
title | Title. |
message | Formatted message. |
paramList | Format parameter list. |
ProgramHelper RaiseEvent | ( | string | parameter, |
string | value, | ||
string | description | ||
) |
Raise a parameter event and set the parameter with the specified value.
parameter | Parameter name. |
value | The new parameter value to set. |
description | Event description. |
ProgramHelper RaiseEvent | ( | ModuleHelper | sourceModule, |
string | parameter, | ||
string | value, | ||
string | description | ||
) |
Raise a module parameter event and set the parameter with the specified value.
module | The module source of this event. |
parameter | Parameter name. |
value | The new parameter value to set. |
description | Event description. |
void GoBackground | ( | ) |
This command is usually put at the end of the "Program Code". It is the equivalent of an infinite noop loop.
ModuleParameter Parameter | ( | string | parameterName | ) |
Gets or sets a program parameter.
parameterName | Parameter name. |
Example:
StoreHelper Store | ( | string | storeName | ) |
Gets or creates a persistent data Store for this program.
storeName | Store name. |
|
get |
Gets a value indicating whether the program is running.
true
if this program is running; otherwise, false
.
|
get |
Gets a value indicating whether the program is enabled.
true
if this program is enabled; otherwise, false
.
Get a reference to the Module associated to the program.
Module object associated to the program.