|
@@ -65,11 +65,18 @@ class _HomestayClient:
|
|
|
|
|
|
|
|
async def _fetch_calendar(self) -> dict:
|
|
async def _fetch_calendar(self) -> dict:
|
|
|
async with httpx.AsyncClient(follow_redirects=False) as client:
|
|
async with httpx.AsyncClient(follow_redirects=False) as client:
|
|
|
- r = await client.get(f'{_BASE}/homestay_rooms/calendar', headers=self._headers())
|
|
|
|
|
|
|
+ r = await client.get(
|
|
|
|
|
+ f'{_BASE}/homestay_rooms/calendar',
|
|
|
|
|
+ params={'room_id': self._room_id},
|
|
|
|
|
+ headers=self._headers(),
|
|
|
|
|
+ )
|
|
|
self._check_auth(r)
|
|
self._check_auth(r)
|
|
|
if r.status_code >= 400:
|
|
if r.status_code >= 400:
|
|
|
mark_stale('homestay')
|
|
mark_stale('homestay')
|
|
|
raise HomestayAuthError(f'Homestay calendar fetch failed (HTTP {r.status_code}) — run: {_AUTH_HINT}')
|
|
raise HomestayAuthError(f'Homestay calendar fetch failed (HTTP {r.status_code}) — run: {_AUTH_HINT}')
|
|
|
|
|
+ if 'application/json' not in r.headers.get('content-type', ''):
|
|
|
|
|
+ mark_stale('homestay')
|
|
|
|
|
+ raise HomestayAuthError(f'Homestay session expired — run: {_AUTH_HINT}')
|
|
|
return r.json()
|
|
return r.json()
|
|
|
|
|
|
|
|
async def _get_calendar_data(self) -> dict:
|
|
async def _get_calendar_data(self) -> dict:
|