~martijnbraam/Flask-MultiMQTT

5ac5420a42d49b59e60c8718662134e3ecebf8dd — Martijn Braam 2 months ago 3f1afe9
Improve connection logging
1 files changed, 2 insertions(+), 1 deletions(-)

M flask_multimqtt/__init__.py
M flask_multimqtt/__init__.py => flask_multimqtt/__init__.py +2 -1
@@ 292,7 292,7 @@ class MultiMQTT:
    def _on_connect(self, client, userdata, flags, rc):
        if rc == mqtt.MQTT_ERR_SUCCESS:
            self.connected = True
            _logger.debug("connected")
            _logger.debug(f"connected to {self.host}")
            for name in self.topics:
                topic = self.topics[name]
                if not topic.subscribed:


@@ 330,6 330,7 @@ class MultiMQTT:
            handler()

    def _on_disconnect(self, client, userdata, rc):
        _logger.warning('disconnected from the mqtt server')
        self.connected = False
        for handler in self._handle_disconnect:
            handler()