fix: Retry device name detection when bridge is not ready at startup

The background thread now retries with exponential backoff (5s→60s)
instead of giving up after 3 attempts. Also accepts detected device
name from bridge even when bridge health status is unhealthy.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
MarekWo
2026-02-09 11:14:41 +01:00
parent 1d8449138d
commit f35b4ebe95
2 changed files with 15 additions and 2 deletions
+1 -1
View File
@@ -996,7 +996,7 @@ def fetch_device_name_from_bridge(max_retries: int = 3, retry_delay: float = 2.0
response = requests.get(bridge_health_url, timeout=5)
if response.status_code == 200:
data = response.json()
if data.get('status') == 'healthy':
if data.get('status') == 'healthy' or data.get('device_name_source') == 'detected':
device_name = data.get('device_name')
source = data.get('device_name_source', 'unknown')
if device_name: