Skip to content

Missing "on_publish" event callback in the class IO_MQTT - adafruit_io.py #122

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

Closed
wavesailor opened this issue Jul 3, 2024 · 1 comment · Fixed by #123
Closed

Missing "on_publish" event callback in the class IO_MQTT - adafruit_io.py #122

wavesailor opened this issue Jul 3, 2024 · 1 comment · Fixed by #123
Assignees

Comments

@wavesailor
Copy link

wavesailor commented Jul 3, 2024

The "on_publish" event callback is missing in the class IO_MQTT which is defined in the library module adafruit_io.py. This for the latest library version: adafruit-circuitpython-bundle-py-20240702.zip

class IO_MQTT:
...
    def __init__(self, mqtt_client):
    ...
        # User-defined MQTT callback methods must be init'd to None
        self.on_connect = None
        self.on_disconnect = None
        self.on_message = None
        self.on_subscribe = None
        self.on_unsubscribe = None
        # MQTT event callbacks
        self._client.on_connect = self._on_connect_mqtt
        self._client.on_disconnect = self._on_disconnect_mqtt
        self._client.on_message = self._on_message_mqtt
        self._client.on_subscribe = self._on_subscribe_mqtt
        self._client.on_unsubscribe = self._on_unsubscribe_mqtt
        self._connected = False
        ...
...

It is defined in the class MQTT in library module adafruit_minimqtt.py

class MQTT:
...
    def __init__(
        ...
        # Default topic callback methods
        self._on_message = None
        self.on_connect = None
        self.on_disconnect = None
        self.on_publish = None
        self.on_subscribe = None
        self.on_unsubscribe = None
        ....
...
@brentru
Copy link
Member

brentru commented Jul 3, 2024

@tyeth Want to take a look?

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