From 9f335794e40d8ac1dc6cf7e4065c1112d7ea95ab Mon Sep 17 00:00:00 2001 From: MarekWo Date: Sun, 29 Mar 2026 19:24:45 +0200 Subject: [PATCH] fix(ble): update runtime device name on every connect BLE connections with retries can take >60s, exceeding the startup wait timeout. Move runtime_config.set_device_name() into _connect() so the navbar shows the correct name regardless of connection delay. Also fixes name update on reconnections. Co-Authored-By: Claude Opus 4.6 --- app/device_manager.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/device_manager.py b/app/device_manager.py index 34f440a..1c6e858 100644 --- a/app/device_manager.py +++ b/app/device_manager.py @@ -220,6 +220,11 @@ class DeviceManager: self._device_name = self._self_info.get('name', self.config.MC_DEVICE_NAME) self._connected = True + # Update runtime config so navbar/templates show correct device name + # (even if connection took longer than the startup wait timeout) + from app.config import runtime_config + runtime_config.set_device_name(self._device_name, "device") + # Store device info in database self.db.set_device_info( public_key=self._self_info.get('public_key', ''),