-
Notifications
You must be signed in to change notification settings - Fork 55
add @mqtt_trigger #105
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
add @mqtt_trigger #105
Conversation
I reviewed this and it looks great! I don't have any comments. Really nice work. The next two parts are docs and tests. I realize the tests are not easy to understand, so I can take a crack at that if you want. |
@craigbarratt absolutely! I can handle docs if you can work out whatever the tests for this might look like. |
Docs have been added. As it is now, payload_json is only set in func_args if the payload is valid JSON. Otherwise, it doesn't exist. Could that cause problems? Should we set it to None instead when it is unparsable? |
Looks great. I think the I'm ok with your current approach of it being undefined if |
Yes. A payload will always be a string. So |
This is a quick first attempt. The simplest of test scripts seems to work:
Tests are needed. Though... I'm not sure how to write tests without an mqtt server to test against?
Docs are needed.
Feel free to make edits directly in my repo even if you are unable to test them.
Will fix #98 .