Procházet zdrojové kódy

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 před 4 měsíci
rodič
revize
fac90b89d3
1 změnil soubory, kde provedl 0 přidání a 1 odebrání
  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: