Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugins #41

Open
the-right-solution opened this issue May 19, 2016 · 3 comments
Open

plugins #41

the-right-solution opened this issue May 19, 2016 · 3 comments

Comments

@the-right-solution
Copy link
Contributor

Any documentation on how to get started with the plugins?

@juggie
Copy link
Owner

juggie commented May 19, 2016

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

@the-right-solution
Copy link
Contributor Author

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

@juggie
Copy link
Owner

juggie commented May 21, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants