From 32907bb5c1e5a5bbca1843482e82965e348591fb Mon Sep 17 00:00:00 2001 From: Florent Date: Thu, 26 Feb 2026 16:48:23 -0400 Subject: [PATCH] handle path_hash_size in change_path --- src/meshcore/commands/contact.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/meshcore/commands/contact.py b/src/meshcore/commands/contact.py index 910ff08..5201fc2 100644 --- a/src/meshcore/commands/contact.py +++ b/src/meshcore/commands/contact.py @@ -110,8 +110,15 @@ class ContactCommands(CommandHandlerBase): out_path_hex = contact["out_path"] out_path_len = contact["out_path_len"] else: + path_hash_size = 1 + res = await self.send_device_query() + if not res is None and res.type != EventType.ERROR: + if "path_hash_mode" in res.payload: + path_hash_size = res.payload["path_hash_mode"] + 1 + out_path_hex = path - out_path_len = int(len(path) / 2) + out_path_len = int(len(path) / (2 * path_hash_size)) + # reflect the change contact["out_path"] = out_path_hex contact["out_path_len"] = out_path_len