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 <noreply@anthropic.com>
This commit is contained in:
MarekWo
2026-03-29 19:24:45 +02:00
parent 147a12c8f5
commit 9f335794e4
+5
View File
@@ -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', ''),