mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-05-07 13:54:49 +02:00
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:
@@ -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', ''),
|
||||
|
||||
Reference in New Issue
Block a user