• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

maximunited / imou_life / 25135742586 / 1
90%
master: 90%

Build:
DEFAULT BRANCH: master
Ran 29 Apr 2026 09:53PM UTC
Files 20
Run time 1s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

29 Apr 2026 09:50PM UTC coverage: 71.978% (+1.6%) from 70.339%
25135742586.1

push

github

web-flow
feat: API rate limit visibility with automatic interval adjustment (#10)

* feat: add API rate limit status visibility for users

Add comprehensive rate limit monitoring and user notifications:

**1. Coordinator Changes (coordinator.py)**
- Track rate limit status with new attributes:
  - is_rate_limited: boolean flag
  - rate_limit_count: counter for rate limit occurrences
  - last_error_type: categorize errors (rate_limit, api_error)
  - last_error_message: detailed error description
  - last_successful_update: timestamp of last successful data fetch
- Update tracking on each coordinator refresh

**2. New Diagnostic Sensor (sensor.py)**
- ImouAPIStatusSensor shows real-time API status
- States: "ok", "rate_limited", "error", "unknown"
- Attributes expose detailed information:
  - rate_limited boolean
  - rate_limit_count number
  - last_error_type string
  - last_error_message string
  - last_successful_update ISO timestamp
- Appears as diagnostic entity in device panel

**3. Setup Notification (__init__.py)**
- Check for rate limiting after initial setup
- Create persistent notification if rate limit detected
- Notification includes:
  - Device name
  - Rate limit count
  - Error details
  - Pointer to diagnostic sensor for ongoing monitoring

**4. Translations (en.json)**
- Add entity translations for API status sensor
- Localized state names and attribute descriptions

**User Benefits:**
- See rate limit status in UI without checking logs
- Get notified immediately when rate limiting occurs
- Monitor API health via diagnostic sensor
- Track rate limit frequency over time

All tests pass (211 passed, 1 skipped).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* feat: enhance rate limit visibility with auto-adjustment and reset tracking

Enhance the API rate limit monitoring system with intelligent handling:

**New Capabilities:**

1. **Automatic Scan Interval Adjustment**
   - Doubles scan interval when rate limited (e.g., 15min → 30mi... (continued)

917 of 1274 relevant lines covered (71.98%)

0.72 hits per line

Source Files on job run-3.12 - 25135742586.1
  • Tree
  • List 20
  • Changed 3
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 25135742586
  • d38c0e3b on github
  • Prev Job for on master (#25133899995.1)
  • Next Job for on master (#25136012768.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc