juggie/AlarmServer

plugins

Opened this issue · 3 comments

Any documentation on how to get started with the plugins?

Take a look at the tornado branch. I wrote a quick plugin architecture
there but it's not super documented. There are several examples however.

On Thu, May 19, 2016 at 1:13 PM, the-right-solution <
notifications@github.com> wrote:

Any documentation on how to get started with the plugins?


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#41

Thanks for the response juggie, just started writing a plugin, fairly straight forward. I'm having one issue though, how can I get a user code for the event?

I looked at format_event function where you are using int(parameters[1:5]) to get the code, but it is not working in the plugin. The parameter just seems to contain partition number and not the user code

I won't have time to test for a week (out of town) but from a quick look.

We cut the variable here: https://github.com/juggie/AlarmServer/blob/feature/tornado/core/envisalink.py#L104 (in a odd way too, woops!)

parameters is then passed to two different places, format_event where you see it used but then also to handle_* (where * is handle_event, handle_zone, handle_partition depending on the type of event received). In this case, I am guessing you are triggering a partition event that contains the user code you mentioned, however in handle_partition it simply takes the first character of the parameters (the partition number) and ignores the rest. This is I would expect where you are losing the user code.

As I said I can't fix this right now but this should set you on the right track to fixing the issue. Pull requests are welcomed, I've personally never made use of that feature.