MtfMqttClient
- class mtf.utils.mqtt.client.MtfMqttClient
- client_id = 'mtf-python-mqtt-184'
- rec_messages = []
- on_message_callbacks = {}
- __init__(broker: str = '127.0.0.1', port: int = 1883, topic: str = 'mtf', username: str = '', password: str = '')
- broker = '127.0.0.1'
- port = 1883
- topic = 'mtf'
- username = ''
- password = ''
- connect(broker: str = '127.0.0.1', port: int = 1883, topic: str = 'mtf', username: str = '', password: str = '')
- on_connect(client, userdata, flags, rc)
- subscribe(topics)
- on_disconnect(client, userdata, rc)
- register_on_message_callback(topic, callback)
- on_message(userdata, msg)
- publish(msg: str, topic: str | None = None)
- client_loop_forever()
- client_loop_start()
- client_loop_stop(force=False)