Manuel83 / cbpi-mqtt

3 stars 11 forks source link

payload message needs to be customizable #3

Open universam1 opened 7 years ago

universam1 commented 7 years ago

I'm using a Sonoff as a smart Actuator and Sensor. Sensor is working nicely, but the actuating message is fixed in code https://github.com/Manuel83/cbpi-mqtt/blob/1f36edc0634610a850cf742d42fdd3181dab144f/__init__.py#L35 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 commented 7 years ago

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