diff --git a/meshtastic/__init__.py b/meshtastic/__init__.py index 57b810f0..7573e8b0 100644 --- a/meshtastic/__init__.py +++ b/meshtastic/__init__.py @@ -35,6 +35,7 @@ - `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 diff --git a/meshtastic/__main__.py b/meshtastic/__main__.py index f4dbc1d9..5f8edd05 100644 --- a/meshtastic/__main__.py +++ b/meshtastic/__main__.py @@ -1,9 +1,6 @@ """ Main Meshtastic """ - -# We just hit the 1600 line limit for main.py, but I currently have a huge set of powermon/structured logging changes -# later we can have a separate changelist to refactor main.py into smaller files -# pylint: disable=too-many-lines +# pylint: disable=C0302 from typing import List, Optional, Union from types import ModuleType diff --git a/meshtastic/mesh_interface.py b/meshtastic/mesh_interface.py index a3a67b79..c1426b56 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 @@ -1311,6 +1311,14 @@ def _handleFromRadio(self, fromRadioBytes): 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(