Skip to content

Improve Home Assistant compatibility: numeric-only output, 15-min caching, fewer logins#1

Open
brutus6 wants to merge 5 commits intomainfrom
brutus6-patch-1
Open

Improve Home Assistant compatibility: numeric-only output, 15-min caching, fewer logins#1
brutus6 wants to merge 5 commits intomainfrom
brutus6-patch-1

Conversation

@brutus6
Copy link
Copy Markdown
Owner

@brutus6 brutus6 commented Aug 9, 2025

Summary

First off — a huge thank you to @joestanding for the original work on this project. 🙏
It’s been a real help, and this little fork is simply my attempt to make it a touch more “Home-Assistant-friendly” and a bit more forgiving when left running day in, day out.

What’s changed
Keeps hold of your session – Cookies and user info are saved locally so we don’t have to log in every time.

A bit less chatty – Adds a 15-minute cache, so we only ask the API when we really need to.

One door in and out – All requests now go through one _api() method, which:

Silently retries if the network has a little wobble.

Logs back in automatically if your session has wandered off.

No login frenzy – Won’t keep bashing the login endpoint if it’s already failed recently.

Grace under pressure – If the API does go quiet, we’ll politely hand back the last good number rather than sulking.

Why
The aim here is simply to:

Reduce the load on the API.

Keep the data flowing smoothly in Home Assistant.

Make the script “set-and-forget” reliable without nagging the server unnecessarily.

If you’re happy with it, I’ll keep this in sync with upstream in case anything changes on the Gym Group side.

Thanks again for the original code — it made this much easier. 🍵

@brutus6 brutus6 changed the title Update gymapi.py Improve Home Assistant compatibility: numeric-only output, 15-min caching, fewer logins Aug 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant