Compare commits

..

3 Commits

Author SHA1 Message Date
jackos1998 f4d89c06c9 Document backtick-quoting code in prose
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 01:01:28 +01:00
jackos1998 fce36e22b9 Add West Wood Club brand icon and logo
Ship icon/logo (extracted from the app's brand asset) in the component's
`brand/` dir.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 01:00:55 +01:00
jackos1998 475ccf21e6 Strip duplicate club-name prefix from sensor names
With has_entity_name the device name is prepended, so the API's
'West Wood Club <club>' names rendered as 'West Wood Club West Wood
Club <club>'. Strip the prefix to show e.g. 'West Wood Club Dun
Laoghaire'.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 00:48:51 +01:00
9 changed files with 15 additions and 5 deletions
+4
View File
@@ -49,6 +49,10 @@ Python uses **single-quoted strings** (`'...'`). Reformat with
`ruff format --config "format.quote-style='single'" <paths>` (ruff is available via
`nix run nixpkgs#ruff`). Docstrings stay triple-double-quoted (`"""`).
In prose (commit messages, docs, comments), backtick-quote anything code-like —
paths, filenames, identifiers, commands, endpoints — rather than plain or
double-quoted text.
## Working with the capture
Read flows with the mitmproxy Python API:
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

@@ -4,6 +4,10 @@ from datetime import timedelta
DOMAIN = 'west_wood_club'
# Shown as the device name; also the prefix the API puts on every club name
# (e.g. 'West Wood Club Dun Laoghaire'), stripped from per-club entity names.
DEVICE_NAME = 'West Wood Club'
# PerfectGym Go backend (West Wood is a white-label tenant).
BASE_URL = 'https://goapi2.perfectgym.com'
@@ -7,5 +7,5 @@
"integration_type": "service",
"iot_class": "cloud_polling",
"requirements": [],
"version": "0.1.0"
"version": "0.1.2"
}
+5 -3
View File
@@ -11,7 +11,7 @@ from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import CONF_CLUBS, DOMAIN
from .const import CONF_CLUBS, DEVICE_NAME, DOMAIN
from .coordinator import WestWoodConfigEntry, WestWoodCoordinator
@@ -46,12 +46,14 @@ class WestWoodOccupancySensor(CoordinatorEntity[WestWoodCoordinator], SensorEnti
) -> None:
super().__init__(coordinator)
self._club_id = club_id
self._attr_name = name
# has_entity_name prepends the device name, so drop the duplicate prefix
# the API includes (e.g. 'West Wood Club Dun Laoghaire' -> 'Dun Laoghaire').
self._attr_name = name.removeprefix(f'{DEVICE_NAME} ') or name
self._attr_unique_id = f'{entry.entry_id}_{club_id}'
# All club sensors share one device so they group together in the UI.
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, entry.entry_id)},
name='West Wood Club',
name=DEVICE_NAME,
manufacturer='PerfectGym',
)
+1 -1
View File
@@ -15,7 +15,7 @@
west_wood_club = final.buildHomeAssistantComponent {
owner = "deplayer0";
domain = "west_wood_club";
version = "0.1.0";
version = "0.1.2";
src = ./.;
};
};