Skip to content

fix: resolve 429 rate limit errors by implementing CoordinatorEntity pattern - #67

Merged
jmdevita merged 2 commits into
mainfrom
fix/issue-66-coordinator-rate-limit
Nov 16, 2025
Merged

jmdevita merged 2 commits into
mainfrom
fix/issue-66-coordinator-rate-limit

Conversation

@jmdevita

Copy link
Copy Markdown
Owner

Fixes #66

The integration was hitting API rate limits (20 requests/hour) due to an antipattern where each of the 4 sensors had independent SCAN_INTERVAL timers and manually called coordinator.async_request_refresh(). This resulted in 20+ API calls per hour instead of the expected 12.

Changes:

  • Refactored all 4 sensor classes to inherit from CoordinatorEntity
  • Removed SCAN_INTERVAL to let the coordinator control update timing
  • Replaced async_update() methods with _handle_coordinator_update()
  • Removed manual async_request_refresh() calls from sensors
  • Fixed services.py error message: "20 per day" → "20 per hour"

Result: Exactly 12 API calls per hour (one every 5 minutes), instead of 20+ when the sensors' timers were out of sync.

@github-actions github-actions Bot added the fix label Nov 12, 2025
@jmdevita
jmdevita merged commit 7b2888f into main Nov 16, 2025
11 of 12 checks passed
@jmdevita
jmdevita deleted the fix/issue-66-coordinator-rate-limit branch November 16, 2025 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Too many requests in error log

1 participant