Source: factory.core/ObjMqtt.py
A class to handle MQTT connections and messaging, leveraging the global
configuration for setup.
Message processing and database writes run in a dedicated worker process
(_queue_worker_process) so that each process owns its own database
...
| Method | Signature | Description |
|---|---|---|
| connect | connect(topic: str = None) |
Connects to the MQTT broker using the configured credentials. |
| publish | publish(topic, payload, retain = False) |
Publishes a message to a specified topic on the MQTT broker. |
| disconnect | disconnect() |
Disconnects from the MQTT broker and shuts down all worker processes. |
| get_topics | get_topics() |
Returns the set of unique topics received since the client connected. |
| transmit_message | transmit_message(topic: str, message_text: str, attachment_filepath: str = '') -> None |
Publishes a message, optionally with an image, to a specified MQTT |
| monitor_topics | monitor_topics(topic: str, use_tui: bool = False) |
Connects to the MQTT broker and monitors a specified topic. |
Connects to the MQTT broker and monitors messages from the specified topic.