mirror of
https://github.com/meshtastic/python.git
synced 2025-12-30 19:37:52 -05:00
Add handling of clientNotification on FromRadio, sending a pubsub message
This commit is contained in:
@@ -35,6 +35,7 @@ type of packet, you should subscribe to the full topic name. If you want to see
|
||||
- `meshtastic.receive.data.portnum(packet)` (where portnum is an integer or well known PortNum enum)
|
||||
- `meshtastic.node.updated(node = NodeInfo)` - published when a node in the DB changes (appears, location changed, username changed, etc...)
|
||||
- `meshtastic.log.line(line)` - a raw unparsed log line from the radio
|
||||
- `meshtastic.clientNotification(notification, interface) - a ClientNotification sent from the radio
|
||||
|
||||
We receive position, user, or data packets from the mesh. You probably only care about `meshtastic.receive.data`. The first argument for
|
||||
that publish will be the packet. Text or binary data packets (from `sendData` or `sendText`) will both arrive this way. If you print packet
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"""Mesh Interface class
|
||||
"""
|
||||
# pylint: disable=R0917
|
||||
# pylint: disable=R0917,C0302
|
||||
|
||||
import collections
|
||||
import json
|
||||
@@ -1311,6 +1311,14 @@ class MeshInterface: # pylint: disable=R0902
|
||||
self._handleLogRecord(fromRadio.log_record)
|
||||
elif fromRadio.HasField("queueStatus"):
|
||||
self._handleQueueStatusFromRadio(fromRadio.queueStatus)
|
||||
elif fromRadio.HasField("clientNotification"):
|
||||
publishingThread.queueWork(
|
||||
lambda: pub.sendMessage(
|
||||
"meshtastic.clientNotification",
|
||||
notification=fromRadio.clientNotification,
|
||||
interface=self,
|
||||
)
|
||||
)
|
||||
|
||||
elif fromRadio.HasField("mqttClientProxyMessage"):
|
||||
publishingThread.queueWork(
|
||||
|
||||
Reference in New Issue
Block a user