Have a plugin HS3 (Paraphrase which gives a random response back to commands) and it worked fine. Porting and converting to HS4 and I can't get the PluginFunction to work (Legacy or HS4).
What it gets is simple an [Ini] file section - like 'Motion Detect' and an Arrary of Ini style replacement markers (Location=Study, Time=14:00).
Here's the call line I used to have -
Dim Plugin As New HomeSeerAPI.PluginAccess(CType(hs, HomeSeerAPI.IHSApplication), "Paraphrase", "")
Return CType(Plugin.PluginFunction(ID, Replacements.Split("|"c)), String)
Here is what I've tried for the new HS4 -
Return("" & hs.PluginFunction("HSPI-Paraphrase", "PluginFunction", Replacements.Split("|"c)))
In the plugin (which is initialized), I tried both of these -
Protected Overloads Function PluginFunction(procName As String,params As Object()) As Object
Console.WriteLine("Called PlugIn " & procName)
Return (myParaphrase.Action(procName, params))
End Function
Public Function Response(procName As String,params As Object()) As Object
'Console.WriteLine("Called PlugIn " & procName)
Return (myParaphrase.Action("action", params))
End Function
Breakpoints on these never get reached (unlike Intiialize/InitIO).
Any idea what I'm doing wrong - or even better a simple example!
(There aren't any in the sample plugins.)
Help appreciate, thank you.
James
What it gets is simple an [Ini] file section - like 'Motion Detect' and an Arrary of Ini style replacement markers (Location=Study, Time=14:00).
Here's the call line I used to have -
Dim Plugin As New HomeSeerAPI.PluginAccess(CType(hs, HomeSeerAPI.IHSApplication), "Paraphrase", "")
Return CType(Plugin.PluginFunction(ID, Replacements.Split("|"c)), String)
Here is what I've tried for the new HS4 -
Return("" & hs.PluginFunction("HSPI-Paraphrase", "PluginFunction", Replacements.Split("|"c)))
In the plugin (which is initialized), I tried both of these -
Protected Overloads Function PluginFunction(procName As String,params As Object()) As Object
Console.WriteLine("Called PlugIn " & procName)
Return (myParaphrase.Action(procName, params))
End Function
Public Function Response(procName As String,params As Object()) As Object
'Console.WriteLine("Called PlugIn " & procName)
Return (myParaphrase.Action("action", params))
End Function
Breakpoints on these never get reached (unlike Intiialize/InitIO).
Any idea what I'm doing wrong - or even better a simple example!
(There aren't any in the sample plugins.)
Help appreciate, thank you.
James
Comment