IPS Module Helper Class combines often used functions and constants.
More...
|
| __construct ($InstanceID, $json_file) |
| Constructor.
|
|
| Create () |
| Create function.
|
|
| ApplyChanges () |
| Apply function.
|
|
|
const | IPS_KERNELMESSAGE = 10100 |
| IPS Message IDs.
|
|
const | KR_INIT = 10102 |
| Kernel Status "INIT".
|
|
const | KR_READY = 10103 |
| Kernel Status "Ready".
|
|
const | KR_UNINIT = 10104 |
| Kernel Status "UnInit".
|
|
const | ST_AKTIV = 102 |
| Module Status aktive.
|
|
const | ST_INACTIV = 104 |
| Module Status "inactive".
|
|
const | ST_ERROR = 201 |
| Module Status "Error".
|
|
const | ST_NOPARENT = 202 |
| Custom Module Status "NoParent".
|
|
const | VT_Boolean = 0 |
| IPS Variable Type Boolean.
|
|
const | VT_Integer = 1 |
| IPS Variable Type Integer.
|
|
const | VT_Float = 2 |
| IPS Variable Type Float.
|
|
const | VT_String = 3 |
| IPS Variable Type String.
|
|
const | IM_CHANGESTATUS =10505 |
| Instance Message Status change.
|
|
const | VM_DELETE =10602 |
| Variable Message Delete.
|
|
const | VM_UPDATE =10603 |
| Variable Message Update.
|
|
|
| HasActiveParent ($id=0) |
| Check if a parent is active.
|
|
| isActive ($id=0) |
| Check if the given Instance is active.
|
|
| GetInstanceStatus ($id=0) |
| Retrieve instance status.
|
|
| GetParent ($id=0) |
| Check if a parent for Instance $id exists.
|
|
| GetCapList () |
| Get Property Caplist.
|
|
| GetCaps () |
| returns array of defined capabilities for this device Format:"cap:action;"
|
|
| GetActions () |
| returns array of defined Actions for this device
|
|
| CreateStatusVars () |
| create status variables out of capvar definitions from device
|
|
| SetStatusVariables () |
| remove variables not matching actual capabilities
|
|
| SwitchStatus ($val) |
| parses switch status values to true/false
|
|
| SemEnter ($resource) |
| Enter/Lock semaphore.
|
|
| SemLeave ($resource) |
| Leave/unlock Semaphore.
|
|
| check_profile ($pname, $typ, $prefix, $suffix, $icon, $min, $max, $step, $digit=0, $drop=false) |
| Check profile by name if exists, else create.
|
|
| drop_var ($ident) |
| Delete a Variable by name if exists and assigned events.
|
|
| GetLocalBuffer () |
| Get status variable Buffer contains incoming data from IO, act as regVar.
|
|
| SetLocalBuffer ($val) |
| Set status variable Buffer.
|
|
| debug ($topic, $data) |
| Log an debug message PHP modules cannot enter data to debug window,use messages instead.
|
|
| isDebug () |
| check if debug is enabled
|
|
| debuglog ($data) |
| Log Debug to its own file.
|
|
|
| $module_data = array() |
| Vital module data build out of module.json.
|
|
| $DEBUGLOG = '' |
| optional filename of a debug log (fully qualified)
|
|
| $name = '' |
| Modul name for fast access.
|
|
| $capvars = array() |
| Device capabilities to be overwrite in implementation.
|
|
| $actions = array() |
| Device action capabilities to be overwrite in implementation.
|
|
| $module_interfaces |
| often needed module GUIDs
|
|
| $useBufferVar =false |
| Use StatusVariable as buffer (if Get/SetBuffer module functions are not available in IPS <4.1)
|
|
IPS Module Helper Class combines often used functions and constants.
◆ __construct()
__construct |
( |
|
$InstanceID, |
|
|
|
$json_file |
|
) |
| |
Constructor.
- Parameters
-
integer | $InstanceID | |
string | $json_file | Path to module.json |
◆ check_profile()
check_profile |
( |
|
$pname, |
|
|
|
$typ, |
|
|
|
$prefix, |
|
|
|
$suffix, |
|
|
|
$icon, |
|
|
|
$min, |
|
|
|
$max, |
|
|
|
$step, |
|
|
|
$digit = 0 , |
|
|
|
$drop = false |
|
) |
| |
|
protected |
Check profile by name if exists, else create.
- Parameters
-
String | $pname | Name |
integer | $typ | Variable Typ (0..3) |
String | $prefix | Prefix before value |
String | $suffix | Suffix after value |
String | $icon | Icon Name |
integer | $min | min value |
integer | $max | max value |
integer | $step | step value |
integer | $digit | digits for formatting |
boolean | $drop | drop existing profile first |
◆ debug()
Log an debug message PHP modules cannot enter data to debug window,use messages instead.
- Parameters
-
◆ debuglog()
Log Debug to its own file.
- Parameters
-
◆ drop_var()
Delete a Variable by name if exists and assigned events.
- Parameters
-
◆ GetActions()
returns array of defined Actions for this device
- Returns
- array
◆ GetCapList()
Get Property Caplist.
- Returns
- string
◆ GetCaps()
returns array of defined capabilities for this device Format:"cap:action;"
- Returns
- array
◆ GetInstanceStatus()
GetInstanceStatus |
( |
|
$id = 0 | ) |
|
|
protected |
Retrieve instance status.
- Parameters
-
- Returns
- mixed
◆ GetLocalBuffer()
Get status variable Buffer contains incoming data from IO, act as regVar.
- Returns
- String
◆ GetParent()
Check if a parent for Instance $id exists.
- Parameters
-
- Returns
- integer
◆ HasActiveParent()
HasActiveParent |
( |
|
$id = 0 | ) |
|
|
protected |
Check if a parent is active.
- Parameters
-
- Returns
- bool
◆ isActive()
Check if the given Instance is active.
- Parameters
-
- Returns
- bool
◆ isDebug()
check if debug is enabled
- Returns
- bool
◆ SemEnter()
Enter/Lock semaphore.
- Parameters
-
- Returns
- bool
◆ SemLeave()
Leave/unlock Semaphore.
- Parameters
-
◆ SetLocalBuffer()
Set status variable Buffer.
- Parameters
-
◆ SwitchStatus()
parses switch status values to true/false
- Parameters
-
- Returns
- bool
◆ IPS_KERNELMESSAGE
const IPS_KERNELMESSAGE = 10100 |
The documentation for this class was generated from the following file: