From a097161dbc396ec782b167c43e57c82bedfe0bdf Mon Sep 17 00:00:00 2001 From: Ian McEwen Date: Mon, 16 Jun 2025 12:45:14 -0700 Subject: [PATCH] Add a sendMqttClientProxyMessage helper for client proxy implementation --- meshtastic/mesh_interface.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/meshtastic/mesh_interface.py b/meshtastic/mesh_interface.py index a3a67b7..cf9009c 100644 --- a/meshtastic/mesh_interface.py +++ b/meshtastic/mesh_interface.py @@ -1,6 +1,6 @@ """Mesh Interface class """ -# pylint: disable=R0917 +# pylint: disable=R0917,C0302 import collections import json @@ -477,6 +477,18 @@ class MeshInterface: # pylint: disable=R0902 priority=mesh_pb2.MeshPacket.Priority.ALERT ) + def sendMqttClientProxyMessage(self, topic: str, data: bytes): + """Send an MQTT Client Proxy message to the radio. + + Topic and data should be the MQTT topic and the message + payload from an MQTT broker, respectively.""" + prox = mesh_pb2.MqttClientProxyMessage() + prox.topic = topic + prox.data = data + toRadio = mesh_pb2.ToRadio() + toRadio.mqttClientProxyMessage.CopyFrom(prox) + self._sendToRadio(toRadio) + def sendData( self, data,