Fix default polling interval to prevent API rate limiting#272
Open
ulfschnabel wants to merge 1 commit into
Open
Fix default polling interval to prevent API rate limiting#272ulfschnabel wants to merge 1 commit into
ulfschnabel wants to merge 1 commit into
Conversation
- Change default from 10s to 300s (5 minutes) - Add validation warnings for intervals < 60s - Update translations with API limit guidance - Prevents rate limiting for typical 4-30 device setups Fixes LaggAt#106, LaggAt#107, LaggAt#129, LaggAt#190, LaggAt#78 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix default polling interval to prevent API rate limiting
Problem
The current default polling interval of 10 seconds causes users to hit Govee's API rate limit with just a few devices. This is the root cause of many rate limit issues reported in #106, #107, #129, #190, and others.
Why 10 seconds is too aggressive:
Govee API Limit: 10,000 requests per 24 hours
Current behavior (10s polling):
Real-world impact:
Solution
This PR changes the default polling interval from 10s → 300s (5 minutes) and adds validation warnings for low intervals.
New behavior (300s polling):
With 300s (5 minute) default:
API Usage Calculator:
Changes Made
1. config_flow.py
default=10→default=300(lines 85 and 175)validate_delay()function that logs warnings for intervals < 60s2. translations/en.json
Backward Compatibility
✅ Existing installations unchanged - Only affects new configurations
✅ Users can still choose any value - No hard restrictions added
✅ Warning-only approach - Logs info but doesn't block configuration
User Experience Improvements
Before:
After:
Complements Existing Features
This works perfectly with the existing "use_assumed_state" option (enabled by default):
Users can also implement "poll on state change" automations for immediate verification after controls (as documented in issue discussions).
Testing
Tested with:
Related Issues
Fixes/Addresses:
Additional Context
The 10-second default was likely set before the 10,000/day limit existed or became strictly enforced. Govee has gotten stricter with rate limiting over time, making the old default problematic.
With modern Home Assistant's "assumed state" feature, users get instant UI feedback regardless of polling interval, so there's no UX downside to longer intervals.
This single change will prevent the majority of rate limit issues users encounter and make the integration work reliably out of the box.