diff --git a/src/meshcore_cli/meshcore_cli.py b/src/meshcore_cli/meshcore_cli.py index ab8e296..76ca180 100644 --- a/src/meshcore_cli/meshcore_cli.py +++ b/src/meshcore_cli/meshcore_cli.py @@ -35,7 +35,7 @@ import re from meshcore import MeshCore, EventType, logger # Version -VERSION = "v1.5.1" +VERSION = "v1.5.2" # default ble address is stored in a config file MCCLI_CONFIG_DIR = str(Path.home()) + "/.config/meshcore/" @@ -237,13 +237,18 @@ async def handle_log_rx(event): if payload_type == 0x05: # flood msg / channel if handle_log_rx.channel_echoes: - chan_name = "" - if "message" in event.payload : + if "chan_name" in event.payload: chan_name = event.payload["chan_name"] + else: + chan_name = "" + + if "message" in event.payload : message = event.payload["message"] - elif handle_log_rx.echo_unk_chans: - chan_name = event.payload["chan_hash"] - message = event.payload["crypted"] + elif handle_log_rx.echo_unk_chans or chan_name != "": + if chan_name == "": + chan_name = event.payload["chan_hash"] + if "crypted" in event.payload: + message = event.payload["crypted"] if chan_name != "" : width = os.get_terminal_size().columns