Skip to content

fix(ifpaevents): stop crashing; explain a missing or rejected API key - #987

Merged
tavdog merged 1 commit into
tronbyt:mainfrom
coreyhulse:ifpaevents-fixes
Dec 4, 2026
Merged

tavdog merged 1 commit into
tronbyt:mainfrom
coreyhulse:ifpaevents-fixes

Conversation

@coreyhulse

Copy link
Copy Markdown
Contributor

Hello, I'm the original author of the IFPA Events app. I never got the SECRETS key working properly on Tidbyt, but in the fork over to Tronbyt that became a user-contributed field anyway.

The version here could crash or show a blank screen; this fixes that and makes the screens explain what's wrong.

This is my first time contributing so let me know if I'm doing something wrong.

Fixes

  • Fewer than 3 events no longer crashes (list index 2 out of range), nor does a location without a locality (key "locality" not in dict).
  • IFPA answers a bad API key with HTTP 200 and {"error": "API_KEY was not found"}, which the app used to treat as data. It now shows "IFPA did not accept the API key".
  • With no key set it says so ("Add your IFPA API key in the app settings") and doesn't call IFPA. With no events nearby: "No events within 50 miles".
  • If IFPA is down or returns something that isn't JSON, the app skips the cycle (return []).
  • A Max Distance that isn't a positive number falls back to 50 miles.

Display

  • Each row reads date (yellow), city (blue), tournament name (white), and waits 2 seconds before scrolling so the date can be read.
  • 64x64 panels show 6 events instead of 3; the place name in the header is cut to fit.

Other

  • recommendedInterval 5 → 60: IFPA data is cached for an hour, so rendering every 5 minutes only repeated the same screen.
  • README rewritten (fixed image link, setup and settings); previews regenerated.

Testing

  • pixlet check passes.
  • Rendered 8 cases with pixlet v0.55.1, all passing: no key, rejected key, no events, events on 64x32 and 64x64, a radius with fewer than 3 events, an invalid Max Distance, and a location without a locality. The version on main failed 6 of the 8.
  • Running on my own Tidbyt Gen 2 with Tronbyt firmware.

- Fewer than 3 events no longer crashes (index out of range), nor does a
  location without a locality.
- Shows a message when no IFPA API key is set, when IFPA rejects the key
  (it answers HTTP 200 with an error), and when there are no events nearby.
  Skips the cycle if IFPA is down or returns something that isn't JSON.
- Rows read date (yellow), city (blue), tournament name (white), and wait
  2 seconds before scrolling so the date can be read.
- 64x64 panels show 6 events; the header place name is cut to fit.
- A Max Distance that isn't a positive number falls back to 50 miles.
- recommendedInterval 5 -> 60 (data is cached for an hour); README and
  previews updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coreyhulse
coreyhulse requested a review from tavdog as a code owner December 4, 2026 16:50
@tavdog
tavdog merged commit e539153 into tronbyt:main Dec 4, 2026
1 check passed
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.

2 participants