def _cb_client_disconnect(self, client, userdata, response_code):
if not self._mqtt_client:
return
if response_code == mqtt.MQTT_ERR_SUCCESS: # intentional disconnect
self._mqtt_client = None
LOGGER.debug("Connection closed for %s", self._device_id)
self._fire_event("close")
else:
LOGGER.debug("Connection abnormally ended for %s, reconnecting...", self._device_id)
self._wrapped_reconnect()
评论列表
文章目录