Просмотр исходного кода

Accept API WARN status as a successful connection test

A degraded/warn API response may return a non-2xx HTTP status while auth
is still valid. Dropping raise_for_status() so only 401/403 trigger an
auth error and real connection failures (exceptions) still block setup.
ZiB 4 месяцев назад
Родитель
Сommit
fac90b89d3
1 измененных файлов с 0 добавлено и 1 удалено
  1. 0 1
      custom_components/room_cal_ha/config_flow.py

+ 0 - 1
custom_components/room_cal_ha/config_flow.py

@@ -342,7 +342,6 @@ async def _test_api_connection(hass: Any, base_url: str, token: str) -> None:
     async with session.get(url, headers={"Authorization": f"Bearer {token}"}) as resp:
       if resp.status in (401, 403):
         raise _ApiAuthError(f"HTTP {resp.status}")
-      resp.raise_for_status()
   except _ApiAuthError:
     raise
   except Exception as exc: