From fb2c947a14e777eccde08758d9c4c5d1f1ba62d0 Mon Sep 17 00:00:00 2001 From: pablorevilla-meshtastic Date: Tue, 19 May 2026 16:21:30 -0700 Subject: [PATCH] fix error with QR code not loading node's role --- meshview/web_api/api.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/meshview/web_api/api.py b/meshview/web_api/api.py index 4ba138c..9c6738c 100644 --- a/meshview/web_api/api.py +++ b/meshview/web_api/api.py @@ -1041,6 +1041,7 @@ async def api_node_qr(request): try: from meshtastic.protobuf.admin_pb2 import SharedContact + from meshtastic.protobuf.config_pb2 import Config from meshtastic.protobuf.mesh_pb2 import User user = User() @@ -1058,6 +1059,13 @@ async def api_node_qr(request): user.hw_model = hw_model_value except (AttributeError, TypeError): pass + if node.role: + try: + role_value = getattr(Config.DeviceConfig.Role, node.role.upper(), None) + if role_value is not None: + user.role = role_value + except (AttributeError, TypeError): + pass contact = SharedContact() contact.node_num = node_id @@ -1077,6 +1085,7 @@ async def api_node_qr(request): "node_id": node_id, "long_name": node.long_name, "short_name": node.short_name, + "role": node.role, "meshtastic_url": meshtastic_url, } )