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

payload message needs to be customizable #3

Open
universam1 opened this issue Oct 6, 2017 · 1 comment
Open

payload message needs to be customizable #3

universam1 opened this issue Oct 6, 2017 · 1 comment

Comments

@universam1
Copy link

I'm using a Sonoff as a smart Actuator and Sensor. Sensor is working nicely, but the actuating message is fixed in code

self.api.cache["mqtt"].client.publish(self.topic, payload=json.dumps({"state": "on"}), qos=0, retain=False)
as {"state": "on"} which is not compatible in my case. My Sonoff is expecting a mere string on in this regard.

Therefore, I would like to ask to make the on and off messages customizable, a user could just predefine two string parameter as off and on.

@mrillies
Copy link
Contributor

Yep that would work, very similar to the code used in HTTP Actor.

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