v1.5.0 - Code Quality & Resilience
π Major Release: Code Quality & Resilience
v1.5.0 brings significant improvements to make Serac more reliable, debuggable, and maintainable.
β¨ What's New
π Error Retry Logic with Exponential Backoff
Serac now automatically retries failed API calls with intelligent backoff:
How it works:
- First attempt fails β Wait 1s, retry
- Second attempt fails β Wait 2s, retry
- Third attempt fails β Wait 4s, retry
- After 4 total attempts β Report failure
Smart error handling:
- β Retries on: Network errors, timeouts, 5xx server errors
- β No retry on: 401 (auth), 403 (forbidden), 404 (not found)
Impact:
- Before: Single network hiccup β Update fails β Wait 1 hour for next try
- Now: Network hiccup β Automatic recovery β Success!
Applies to:
- All weather API calls (current, daily, hourly, air quality)
- All avalanche bulletin calls (BRA)
π Enhanced Logging with Timing & Context
Every coordinator update now includes rich information:
Example logs:
INFO: Weather update completed for home in 1.23s: 8 daily forecasts, 48 hourly forecasts, available air quality
DEBUG: Weather data details for home: elevation=1035m, 6h forecasts=6, current_temp=2.5Β°C
INFO: BRA update completed for Aravis in 0.87s: risk_today=2, risk_tomorrow=3, bulletin_date=2026-02-12T16:00:00
DEBUG: BRA details for Aravis: altitude_limit=2000m, high_risk=MarquΓ©, low_risk=Faible
ERROR: Failed to fetch weather data for home after 5.42s (lat=46.0304, lon=6.3066): Connection timeout
What's included:
- β±οΈ Timing information (elapsed seconds)
- π Location context (coordinates, massif names)
- π Data summaries (forecast counts, risk levels)
- π Error details (type, context, coordinates)
Benefits:
- Identify slow API calls
- Easier troubleshooting with context
- Better support via detailed logs
π§ͺ Comprehensive Unit Tests
Added 29 tests covering core functionality:
Test coverage:
-
β Retry logic (6 tests)
- Success on first attempt
- Success after failures
- Max retries behavior
- Auth error handling (no retry)
- Server error handling (retry)
-
β AromeCoordinator (3 tests)
- Successful weather updates
- Updates without air quality
- API error handling
-
β BraCoordinator (3 tests)
- Successful bulletin updates
- Out of season handling
- API error handling
-
β Config flow (10 tests)
- Coordinate validation
- Prefix validation
- Character/length rules
- Prefix suggestions
For developers:
# Install test dependencies
pip install -r requirements_test.txt
# Run all tests
pytest tests/
# Run with coverage
pytest --cov=custom_components.serac tests/π― Key Benefits
For All Users
π‘οΈ More Reliable
- Automatic recovery from temporary network issues
- Fewer "unavailable" sensors from transient errors
- Robust handling of API timeouts
π Easier Debugging
- Download diagnostics (v1.4.2+) with enhanced logs
- Timing info helps identify performance issues
- Context-rich error messages for support
For Developers
π§° Better Maintainability
- Unit tests catch regressions
- Mock-based testing (no live API needed)
- Foundation for CI/CD pipeline
π¦ Installation
Via HACS (Recommended)
- Open HACS β Integrations
- Find Serac β Click Update to v1.5.0
- Restart Home Assistant
Manual Installation
- Download from Releases
- Extract to
config/custom_components/serac/ - Restart Home Assistant
π§ Technical Details
Changes
- coordinator.py: Add retry logic + enhanced logging
- manifest.json: Version 1.4.2 β 1.5.0
- tests/: New test suite (29 tests)
- pytest.ini: Pytest configuration
- requirements_test.txt: Test dependencies
Compatibility
- β No breaking changes
- β Drop-in replacement for v1.4.x
- β No config changes needed
- β All existing sensors continue working
Performance
- Retry logic adds minimal overhead (only on failures)
- Enhanced logging negligible impact
- Tests don't run in production
π Stats
- 771 lines added across 8 files
- 29 unit tests created
- 3 retry attempts per API call
- 100% backward compatible
π Bug Fixes
- Improved error handling for transient network issues
- Better logging context prevents ambiguous errors
π What's Next
v1.6.0 (Planned - 2-3 weeks)
- Weather Alerts (Vigilance) - MΓ©tΓ©o-France severe weather warnings
- Department-level alerts with color codes (Green/Yellow/Orange/Red)
- Alert types: wind, rain/flood, thunderstorms, snow/ice, fog
See ROADMAP.md for full development plan.
π Thank You
To all Serac users - this release focuses on reliability and quality. Your feedback helps make Serac better!
Special thanks to the Home Assistant community for development support.
Full Changelog: v1.4.2...v1.5.0
Made with β€οΈ for the mountain community ποΈ