Skip to content

Commit 4adcbb6

Browse files
authored
Merge pull request #743 from ianmcorvidae/client-notifications
Add handling of clientNotification on FromRadio
2 parents cad5d18 + 125f634 commit 4adcbb6

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

meshtastic/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
- `meshtastic.receive.data.portnum(packet)` (where portnum is an integer or well known PortNum enum)
3636
- `meshtastic.node.updated(node = NodeInfo)` - published when a node in the DB changes (appears, location changed, username changed, etc...)
3737
- `meshtastic.log.line(line)` - a raw unparsed log line from the radio
38+
- `meshtastic.clientNotification(notification, interface) - a ClientNotification sent from the radio
3839
3940
We receive position, user, or data packets from the mesh. You probably only care about `meshtastic.receive.data`. The first argument for
4041
that publish will be the packet. Text or binary data packets (from `sendData` or `sendText`) will both arrive this way. If you print packet

meshtastic/mesh_interface.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,6 +1330,14 @@ def _handleFromRadio(self, fromRadioBytes):
13301330
self._handleLogRecord(fromRadio.log_record)
13311331
elif fromRadio.HasField("queueStatus"):
13321332
self._handleQueueStatusFromRadio(fromRadio.queueStatus)
1333+
elif fromRadio.HasField("clientNotification"):
1334+
publishingThread.queueWork(
1335+
lambda: pub.sendMessage(
1336+
"meshtastic.clientNotification",
1337+
notification=fromRadio.clientNotification,
1338+
interface=self,
1339+
)
1340+
)
13331341

13341342
elif fromRadio.HasField("mqttClientProxyMessage"):
13351343
publishingThread.queueWork(

0 commit comments

Comments
 (0)