Added Meshtastic ID to messages bridged to MeshCore

MeshCore messages already prepend the MeshCore ID to messages bridged to Meshtastic, so now conversely, Meshtastic IDs are prepended to messages bridged to MeshCore.
This commit is contained in:
Aido committed 2026-05-15 22:15:53 +01:00
1 parent a51a3e09ad
commit da3efd05e8
2 files changed
+6 -1

No files matched your search

+1
View File
@@ -12,6 +12,7 @@
- **Added** configuration settings for bridging specific channels
- **Fixed** companion radio decoding to be more robust
- **Added** `channel_index` key to `external_message` dict
- **Added** Meshtastic ID to messages bridged to MeshCore
---
## Version 2.0.0 - Comprehensive Code Review and Enhancements (December 31, 2025)
+5 -1
View File
@@ -627,6 +627,10 @@ class MeshcoreHandler:
# CMD_SEND_CHANNEL_TXT_MSG (3)
txt_type = 0
channel_idx = int(item.get("channel_index", 0))
sender_meshtastic_id = item.get("sender_meshtastic_id", "Unknown")
# Prepend Meshtastic ID to outgoing MeshCore message
payload = f"{sender_meshtastic_id}: {payload}"
if self.config.meshtastic_channel_index is not None and self.config.meshcore_channel_index is not None:
if channel_idx == self.config.meshtastic_channel_index:
@@ -642,4 +646,4 @@ class MeshcoreHandler:
encoded = self.protocol_handler.encode({"payload": cmd_payload})
if not encoded:
self.logger.warning("Failed to encode companion text message.")
return encoded
return encoded