PHP Modules by Tommi2Day  4.4
Modules for Symon
Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes
T2DModule Class Reference

IPS Module Helper Class combines often used functions and constants. More...

Inheritance diagram for T2DModule:
APCUPSD AVMAHA CUL EnergyDev FS20WUE MQTTPUB NUT OWN SwitchDev TE923 WDE1 WS2500PC WS300PC WSDEV XS1

Public Member Functions

 __construct ($InstanceID, $json_file)
 Constructor. More...
 
 Create ()
 Create function. More...
 
 ApplyChanges ()
 Apply function.
 

Data Fields

const IPS_KERNELMESSAGE = 10100
 IPS Message IDs. More...
 
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.
 

Protected Member Functions

 HasActiveParent ($id=0)
 Check if a parent is active. More...
 
 isActive ($id=0)
 Check if the given Instance is active. More...
 
 GetInstanceStatus ($id=0)
 Retrieve instance status. More...
 
 GetParent ($id=0)
 Check if a parent for Instance $id exists. More...
 
 GetCapList ()
 Get Property Caplist. More...
 
 GetCaps ()
 returns array of defined capabilities for this device Format:"cap:action;" More...
 
 GetActions ()
 returns array of defined Actions for this device More...
 
 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 More...
 
 SemEnter ($resource)
 Enter/Lock semaphore. More...
 
 SemLeave ($resource)
 Leave/unlock Semaphore. More...
 
 check_profile ($pname, $typ, $prefix, $suffix, $icon, $min, $max, $step, $digit=0, $drop=false)
 Check profile by name if exists, else create. More...
 
 drop_var ($ident)
 Delete a Variable by name if exists and assigned events. More...
 
 GetLocalBuffer ()
 Get status variable Buffer contains incoming data from IO, act as regVar. More...
 
 SetLocalBuffer ($val)
 Set status variable Buffer. More...
 
 debug ($topic, $data)
 Log an debug message PHP modules cannot enter data to debug window,use messages instead. More...
 
 isDebug ()
 check if debug is enabled More...
 
 debuglog ($data)
 Log Debug to its own file. More...
 

Protected Attributes

 $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)
 

Detailed Description

IPS Module Helper Class combines often used functions and constants.

Constructor & Destructor Documentation

__construct (   $InstanceID,
  $json_file 
)

Constructor.

Parameters
integer$InstanceID
string$json_filePath to module.json

Member Function Documentation

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$pnameName
integer$typVariable Typ (0..3)
String$prefixPrefix before value
String$suffixSuffix after value
String$iconIcon Name
integer$minmin value
integer$maxmax value
integer$stepstep value
integer$digitdigits for formatting
boolean$dropdrop existing profile first
Create ( )

Create function.

debug (   $topic,
  $data 
)
protected

Log an debug message PHP modules cannot enter data to debug window,use messages instead.

Parameters
$topic
$data
debuglog (   $data)
protected

Log Debug to its own file.

Parameters
$data
drop_var (   $ident)
protected

Delete a Variable by name if exists and assigned events.

Parameters
String$ident
GetActions ( )
protected

returns array of defined Actions for this device

Returns
array
GetCapList ( )
protected

Get Property Caplist.

Returns
string
GetCaps ( )
protected

returns array of defined capabilities for this device Format:"cap:action;"

Returns
array
GetInstanceStatus (   $id = 0)
protected

Retrieve instance status.

Parameters
int$id
Returns
mixed
GetLocalBuffer ( )
protected

Get status variable Buffer contains incoming data from IO, act as regVar.

Returns
String
GetParent (   $id = 0)
protected

Check if a parent for Instance $id exists.

Parameters
$idinteger InstanceID
Returns
integer
HasActiveParent (   $id = 0)
protected

Check if a parent is active.

Parameters
$idinteger InstanceID
Returns
bool
isActive (   $id = 0)
protected

Check if the given Instance is active.

Parameters
int$id
Returns
bool
isDebug ( )
protected

check if debug is enabled

Returns
bool
SemEnter (   $resource)
protected

Enter/Lock semaphore.

Parameters
$resource
Returns
bool
SemLeave (   $resource)
protected

Leave/unlock Semaphore.

Parameters
$resource
SetLocalBuffer (   $val)
protected

Set status variable Buffer.

Parameters
String$val
SwitchStatus (   $val)
protected

parses switch status values to true/false

Parameters
bool | mixed$val
Returns
bool

Field Documentation

const IPS_KERNELMESSAGE = 10100

The documentation for this class was generated from the following file: