diff --git a/custom_components/west_wood_club/api.py b/custom_components/west_wood_club/api.py index 5ac7195..e5beedf 100644 --- a/custom_components/west_wood_club/api.py +++ b/custom_components/west_wood_club/api.py @@ -9,7 +9,7 @@ from __future__ import annotations import aiohttp -from .const import BASE_URL +from .const import BASE_URL, WHITE_LABEL_ID class WestWoodApiError(Exception): @@ -36,6 +36,7 @@ class WestWoodClient: headers={ 'Authorization': f'bearer {self._token}', 'Accept': 'application/json', + 'X-Go-White-Label-ID': WHITE_LABEL_ID, }, ) as resp: if resp.status in (401, 403): diff --git a/custom_components/west_wood_club/const.py b/custom_components/west_wood_club/const.py index 487eab7..48ec7ff 100644 --- a/custom_components/west_wood_club/const.py +++ b/custom_components/west_wood_club/const.py @@ -11,6 +11,11 @@ DEVICE_NAME = 'West Wood Club' # PerfectGym Go backend (West Wood is a white-label tenant). 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. CONF_TOKEN = 'token' CONF_CLUBS = 'clubs' diff --git a/custom_components/west_wood_club/manifest.json b/custom_components/west_wood_club/manifest.json index 660e1df..fbe1d8e 100644 --- a/custom_components/west_wood_club/manifest.json +++ b/custom_components/west_wood_club/manifest.json @@ -7,5 +7,5 @@ "integration_type": "service", "iot_class": "cloud_polling", "requirements": [], - "version": "0.1.2" + "version": "0.1.3" } diff --git a/flake.nix b/flake.nix index ef9a4f2..274a3de 100644 --- a/flake.nix +++ b/flake.nix @@ -15,7 +15,7 @@ west_wood_club = final.buildHomeAssistantComponent { owner = "deplayer0"; domain = "west_wood_club"; - version = "0.1.2"; + version = "0.1.3"; src = ./.; }; };