Send X-Go-White-Label-ID header
Send the hardcoded West Wood white-label tenant ID on API requests, matching the app. The server doesn't require it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -9,7 +9,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
|
|
||||||
from .const import BASE_URL
|
from .const import BASE_URL, WHITE_LABEL_ID
|
||||||
|
|
||||||
|
|
||||||
class WestWoodApiError(Exception):
|
class WestWoodApiError(Exception):
|
||||||
@@ -36,6 +36,7 @@ class WestWoodClient:
|
|||||||
headers={
|
headers={
|
||||||
'Authorization': f'bearer {self._token}',
|
'Authorization': f'bearer {self._token}',
|
||||||
'Accept': 'application/json',
|
'Accept': 'application/json',
|
||||||
|
'X-Go-White-Label-ID': WHITE_LABEL_ID,
|
||||||
},
|
},
|
||||||
) as resp:
|
) as resp:
|
||||||
if resp.status in (401, 403):
|
if resp.status in (401, 403):
|
||||||
|
|||||||
@@ -11,6 +11,11 @@ DEVICE_NAME = 'West Wood Club'
|
|||||||
# PerfectGym Go backend (West Wood is a white-label tenant).
|
# PerfectGym Go backend (West Wood is a white-label tenant).
|
||||||
BASE_URL = 'https://goapi2.perfectgym.com'
|
BASE_URL = 'https://goapi2.perfectgym.com'
|
||||||
|
|
||||||
|
# Hardcoded West Wood white-label tenant ID (baked into the app binary). Sent as
|
||||||
|
# the X-Go-White-Label-ID header. The server doesn't require it, but it matches
|
||||||
|
# what the app sends. See api.md.
|
||||||
|
WHITE_LABEL_ID = '7d073db5-0ef8-4d78-89ec-4a8bebaf4cbc'
|
||||||
|
|
||||||
# Config entry keys.
|
# Config entry keys.
|
||||||
CONF_TOKEN = 'token'
|
CONF_TOKEN = 'token'
|
||||||
CONF_CLUBS = 'clubs'
|
CONF_CLUBS = 'clubs'
|
||||||
|
|||||||
@@ -7,5 +7,5 @@
|
|||||||
"integration_type": "service",
|
"integration_type": "service",
|
||||||
"iot_class": "cloud_polling",
|
"iot_class": "cloud_polling",
|
||||||
"requirements": [],
|
"requirements": [],
|
||||||
"version": "0.1.2"
|
"version": "0.1.3"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
west_wood_club = final.buildHomeAssistantComponent {
|
west_wood_club = final.buildHomeAssistantComponent {
|
||||||
owner = "deplayer0";
|
owner = "deplayer0";
|
||||||
domain = "west_wood_club";
|
domain = "west_wood_club";
|
||||||
version = "0.1.2";
|
version = "0.1.3";
|
||||||
src = ./.;
|
src = ./.;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user