![]() |
Helper Class Reference 1.4
HomeGenie - Automation Programs API
|
Modules Manager Helper class.
Offers methods for filtering, selecting and operate on a group of modules.
Class instance accessor: Modules
More...
Public Member Functions | |
ModulesManager | InDomain (string domains) |
Select modules belonging to specified domains. | |
ModulesManager | WithAddress (string addresses) |
Select modules with specified address. | |
ModulesManager | WithName (string moduleNames) |
Select modules matching specified names. | |
ModulesManager | OfDeviceType (string deviceTypes) |
Select modules of specified device types. | |
ModulesManager | InGroup (string groups) |
Select modules included in specified groups. | |
ModulesManager | WithParameter (string parameters) |
Select all modules having specified parameters. | |
ModulesManager | WithFeature (string features) |
Select all modules having specified features. | |
ModulesManager | WithoutFeature (string features) |
Select all modules NOT having specified features. | |
ModulesManager | Each (Func< ModuleHelper, bool > callback) |
Iterate through each module in the current selection and pass it to the specified callback . To break the iteration, the callback must return true, otherwise false. | |
ModuleHelper | Get () |
Returns the module in the current selection. If the current selection contains more than one element, the first element will be returned. | |
ModulesManager | Command (string cmd) |
Select an API command to be executed for selected modules. To perform the selected command, Submit method must be called. | |
ModulesManager | IterationDelay (double delaySeconds) |
Used before a command (Submit, On, Off, Toggle, ...), it will put a pause after performing the command for each module in the current selection. | |
object | GetValue (string options="") |
Execute current command on first selected module and return the response value. | |
ModulesManager | Submit (Action< Module, object > callback) |
Submits the command previously specified with Command method. | |
ModulesManager | Submit (string options, Action< Module, object > callback=null) |
Submits the command previously specified with Command method, passing to it the options given by the options parameter. | |
ModulesManager | On () |
Turn on all selected modules. | |
ModulesManager | Off () |
Turn off all selected modules. | |
ModulesManager | Toggle () |
Toggle all selected modules. | |
ModulesManager | Copy () |
Creates a copy of the actual modules selection. | |
ModulesManager | Reset () |
Resets all selection filters. | |
Properties | |
Func< ModulesManager, TsList< Module > > | ModulesListCallback [get, set] |
Gets or sets the modules list on which this helper class will be working on. | |
TsList< Module > | Modules [get] |
Gets the complete modules list. | |
virtual TsList< Module > | SelectedModules [get] |
Return the list of selected modules. | |
List< string > | Groups [get] |
Return the list of control groups. | |
double | Level [get, set] |
Gets or sets "Status.Level" parameter of selected modules. If more than one module is selected, when reading this property the average level value is returned. | |
string | ColorHsb [get, set] |
Gets or sets "Status.ColorHsb" parameter of selected modules. If more than one module is selected, when reading this property the first module color is returned. | |
bool | IsOn [get] |
Gets "on" status ("Status.Level" > 0). | |
bool | IsOff [get] |
Gets "off" status ("Status.Level" == 0). | |
bool | Alarmed [get] |
Gets "alarm" status ("Sensor.Alarm" > 0). | |
bool | MotionDetected [get] |
Gets "motion detection" status ("Sensor.MotionDetect" > 0). | |
double | Temperature [get] |
Gets temperature value ("Sensor.Temperature"). | |
double | Luminance [get] |
Gets luminance value ("Sensor.Luminance"). | |
double | Humidity [get] |
Gets humidity value ("Sensor.Humidity"). | |
Modules Manager Helper class.
Offers methods for filtering, selecting and operate on a group of modules.
Class instance accessor: Modules
ModulesManager InDomain | ( | string | domains | ) |
Select modules belonging to specified domains.
domains | A string containing comma seperated domain names. |
Example:
ModulesManager WithAddress | ( | string | addresses | ) |
Select modules with specified address.
addresses | A string containing comma seperated address values. |
Example:
ModulesManager WithName | ( | string | moduleNames | ) |
Select modules matching specified names.
moduleNames | A string containing comma seperated module names. |
Example:
ModulesManager OfDeviceType | ( | string | deviceTypes | ) |
Select modules of specified device types.
deviceTypes | A string containing comma seperated type names. |
Example:
ModulesManager InGroup | ( | string | groups | ) |
Select modules included in specified groups.
groups | A string containing comma seperated group names. |
Example:
ModulesManager WithParameter | ( | string | parameters | ) |
Select all modules having specified parameters.
parameters | A string containing comma seperated parameter names. |
Example:
ModulesManager WithFeature | ( | string | features | ) |
Select all modules having specified features.
features | A string containing comma separated feature names. |
Example:
ModulesManager WithoutFeature | ( | string | features | ) |
Select all modules NOT having specified features.
features | A string containing comma seperated feature names. |
Example:
ModulesManager Each | ( | Func< ModuleHelper, bool > | callback | ) |
Iterate through each module in the current selection and pass it to the specified callback
. To break the iteration, the callback must return true, otherwise false.
callback | Callback function to call for each iteration. |
Example:
ModuleHelper Get | ( | ) |
Returns the module in the current selection. If the current selection contains more than one element, the first element will be returned.
Example:
ModulesManager Command | ( | string | cmd | ) |
Select an API command to be executed for selected modules. To perform the selected command, Submit
method must be called.
cmd | API command to be performed. |
Example:
ModulesManager IterationDelay | ( | double | delaySeconds | ) |
Used before a command (Submit, On, Off, Toggle, ...), it will put a pause after performing the command for each module in the current selection.
delaySeconds | Delay seconds. |
Example:
object GetValue | ( | string | options = "" | ) |
Execute current command on first selected module and return the response value.
options | Options. |
ModulesManager Submit | ( | Action< Module, object > | callback | ) |
Submits the command previously specified with Command
method.
callback | Optional callback that will be called, for each module in the selection, with the result of the issued command. |
ModulesManager Submit | ( | string | options, |
Action< Module, object > | callback = null |
||
) |
Submits the command previously specified with Command
method, passing to it the options given by the options
parameter.
options | A string containing a slash separated list of options to be passed to the selected command. |
callback | Optional callback that will be called, for each module in the selection, with the result of the issued command. |
ModulesManager On | ( | ) |
Turn on all selected modules.
ModulesManager Off | ( | ) |
Turn off all selected modules.
ModulesManager Toggle | ( | ) |
Toggle all selected modules.
ModulesManager Copy | ( | ) |
Creates a copy of the actual modules selection.
ModulesManager Reset | ( | ) |
Resets all selection filters.
|
getset |
Gets or sets the modules list on which this helper class will be working on.
The modules list callback.
|
get |
Gets the complete modules list.
The modules.
|
get |
Return the list of selected modules.
|
get |
Return the list of control groups.
|
getset |
Gets or sets "Status.Level" parameter of selected modules. If more than one module is selected, when reading this property the average level value is returned.
The level (percentage value 0.00-1.00).
Example:
|
getset |
Gets or sets "Status.ColorHsb" parameter of selected modules. If more than one module is selected, when reading this property the first module color is returned.
The HSB color string (eg. "0.3130718,0.986,0.65").
|
get |
Gets "on" status ("Status.Level" > 0).
true
if at least one module in the current selection is on; otherwise, false
.
|
get |
Gets "off" status ("Status.Level" == 0).
true
if at least one module in the current selection is off; otherwise, false
.
|
get |
Gets "alarm" status ("Sensor.Alarm" > 0).
true
if at least one module in the current is alarmed; otherwise, false
.
|
get |
Gets "motion detection" status ("Sensor.MotionDetect" > 0).
true
if at least one module in the current detected motion; otherwise, false
.
|
get |
Gets temperature value ("Sensor.Temperature").
The temperature parameter of selected module (average value is returned when more than one module is selected).
|
get |
Gets luminance value ("Sensor.Luminance").
The luminance parameter of selected module (average value is returned when more than one module is selected).
|
get |
Gets humidity value ("Sensor.Humidity").
The humidity parameter of selected module (average value is returned when more than one module is selected).