tve / mqboard

Micro Framework for MicroPython Boards Managed via MQTT
MIT License
120 stars 18 forks source link

Error in Hello World example #29

Open jose1711 opened 2 years ago

jose1711 commented 2 years ago

In https://github.com/tve/mqboard/blob/master/mqtt_async/README.md:

def callback(topic, msg, retained, qos): print(topic, msg, retained, qos)
..
config.subs_cb = callback

while in mqtt_async.py there is:

cb = self._subs_cb(topic, msg, bool(retained), qos, dup)

This results in incorrect number of arguments being called:

function takes 4 positional arguments but 5 were given: exception in handler

This can be easily fixed (in README.md):

def callback(topic, msg, retained, qos, dup): print(topic, msg, retained, qos, dup)