I am trying to do a little plugin, but I am struggling just to create an empty plugin.
I created a Device and an Implementation file using the Panasonic example. I have stripped it down to basicly nothing and I still get errors. Could somebody guide me, please?
The snippets look correct, but you’re going to need to define “Errors” (in detail) as that’s a broad term when you’re talking about Luup programming and Device setup.
I’m referring to this part of your original post. You mentioned you “still get errors”, but you left out all the details associated with what those errors are, where you saw them, what you did before you saw them, etc. There’s a long list of things that can go wrong, so these details are critical to any diagnosis/recommendation on next-steps.
Start with Screenshots of these perhaps, as that might tell a bigger story than any textual descriptions…
I got it working if my luup code is without CR, etc. but it is hard to maintain then. Is it because I use a standard notepad as editor on win 7? What is the prefered editor on win?
1. Do I need to recreate a device when the device file is changed and newly uploaded?
No, just restart LuaUPnP (serveral times).
2. Do I need to recreate a device when the implementation file is changed and newly uploaded?
No, just restart LuaUPnP (serveral times).
There is no easy way to remove variables from a device, so depending on the changes to your code it may be
advisable to remove and recreate the device.
3. Do I need to recreate a scene to check the functionality or can I reuse if no canges has been made in the available actions?
No need to recreate the scene.
4. Am I correct that running a scene -> advanced -> pick a device is the easiest way of 'debugging' a plugin action?
Depends on your requirements - [tt]luup.log[/tt], [tt]WAI[/tt], and
Now I am okay with the syntax in the Implementation file and have found what is my problem.
Within the XML implementation file I try to put together a SOAP request. The SOAP request works fine in a separate scene, but the vera XML parser seems to fail as XML tags (used for the SOAP request) are inside the functions tag in the Implementation file.
I can see in the log the following:
01 Jobhandler_LuaUPnP::ParseAllImplementations failed to parse I_Test1.xml <0x400>
01 LuImplementation:: Parse cant parse xml /etc/cmh-ludl//I_Test1.xml <0x400>
My best guess is that I cannot have XML tags like this inside the Implementation xml file:
This makes the block of string look a little more natural, and it will preserve line-breaks (etc) as you wrap the block over multiple lines. It can help improve the readability of the overall code.
[/li]
[li]Lua has library like functionality, put all your code into a .lua file.
In Luup, device files are constrained by the XML characters. You can put the bulk of the Lua code into a separate, plain-text, Library file (.lua) and then include it into your Device file (using [tt]require(…)[/tt])