RegisterGenericEventCB

Purpose

HomeSeer has the ability to raise events in applications and plug-ins when one of a list of specific events in HomeSeer occurs (See RegisterEventCB).  RegisterGenericEventCB allows an application or plug-in writer the opportunity to have custom events raised and to enable other applications and plug-ins to receive those callbacks.

To remove the callback script, call UnRegisterGenericEventCB.

Parameters

Parameter: Generic Type
Type: string
Description: This is a string that identifies the callback.  For example, a type of "MyPlugEvent" would mean that calls to RaiseGenericEventCB using something other than "MyPlugEvent" would be ignored.  This string should be unique, and should be provided to all applications wishing to register to receive these callbacks.  A special value of a single asterisk (*) can be used to indicate that you wish to receive ALL generic type callbacks from other plug-ins/applications.

 

Parameter: Object
Type: Object
Description: This is the object (usually a plug-in) that should receive the callback when it is raised.  The object must have a Name() property that returns a string containing the name of the object (plug-in).

Returns

None.

Example

' register a callback script

Sub RegisterGeneric()

hs.RegisterGenericEventCB "MyPlugEvent", Me
' Or to receive all Generic Types...
hs.RegisterGenericEventCB "*", Me

End Sub
 

Results

After this procedure is called, a call to RaiseGenericEventCB will cause HSEvent in your application to be called by HomeSeer, and it will be passed parameters provided by the code that raised the event.