Releases: eman/nwp500-python
Releases · eman/nwp500-python
v5.0.0
What's Changed
Full Changelog: v4.8.0...v5.0.0
v4.8.0
What's Changed
Full Changelog: v4.7.1...v4.8.0
v4.7.1
Full Changelog: v4.7...v4.7.1
v4.7: Two-Tier MQTT Reconnection & Code Quality Improvements
🚀 Major Improvements
Two-Tier MQTT Reconnection Strategy
- Quick reconnection (attempts 1-9): Fast recovery from transient network issues
- Deep reconnection (every 10th attempt): Full rebuild with credential refresh and subscription recovery
- Unlimited retries: Never gives up permanently (changed from 10 max attempts to unlimited)
- Deep reconnection includes token refresh with fallback to full re-authentication
- Automatic re-establishment of all subscriptions after deep reconnection
Enhanced Error Handling
- Replaced 25 catch-all exception handlers with specific exception types
- Added safety checks for attribute access (hasattr() before e.name)
- Proper exception types:
AwsCrtError,AuthenticationError,TokenRefreshError,RuntimeError,ValueError,TypeError,AttributeError,KeyError - Only 1 legitimate catch-all preserved (EventEmitter for user callback resilience)
New Public API
NavienAuthClient.has_stored_credentialsproperty - Check if credentials available for re-authNavienAuthClient.re_authenticate()method - Perform fresh sign-in with stored credentialsMqttSubscriptionManager.resubscribe_all()method - Restore all subscriptions after reconnection
Code Quality Improvements
- Simplified nested conditions with local variables for readability
- Optimized subscription recovery (break after first failure per topic)
- Fixed subscription failure tracking to use sets for unique counting
- Improved boolean expressions with intermediate variables
- Added exception handling guidelines to Copilot instructions
Bug Fixes
- Eliminated duplicate "Connection interrupted" log messages
- Prevented redundant subscription retry logs
📊 Statistics
- 350 lines added, 70 removed (+280 net)
- 80/80 tests passing (100% pass rate)
- Overall test coverage: 31%
- Zero type errors (mypy)
- All linting checks pass
🔧 Configuration
New configuration parameter:
MqttConnectionConfig(
max_reconnect_attempts=-1, # -1 = unlimited (default, changed from 10)
deep_reconnect_threshold=10, # Deep reconnect every 10 attempts (new)
)🎯 Impact
- Production-ready MQTT reconnection resilience
- Never loses connection permanently
- Handles expired AWS credentials gracefully
- Cleaner, more maintainable codebase
- Better error messages and debugging
Full Changelog: https://github.com/eman/nwp500-python/blob/main/CHANGELOG.rst
v3.1.4
What's Changed
Full Changelog: v3.1.3...v3.1.4
v3.1.3
What's Changed
Full Changelog: v3.1.2...v3.1.3
v3.1.2
What's Changed
Full Changelog: v3.1.1...v3.1.2
v3.1.1
Full Changelog: v3.1.0...v3.1.1
v3.1.0
What's Changed
Full Changelog: v3.0.0...v3.1.0