v0.6.0 MFA support
What's new
MFA support (#85)
Thanks to @erinn (with @mikey0000): accounts with multifactor authentication enabled can now authenticate: authenticate() raises the Cognito challenge exception and respond_to_mfa_challenge(code, mode) completes it via TOTP or SMS. The challenge session is JSON-serializable for cross-process flows (e.g. Home Assistant config flows). See the README for usage.
Hardened authentication & retries
- API methods still authenticate automatically on first use. No breaking change for non-MFA users
- Sessions can resume from a refresh token alone; access tokens refresh automatically on expiry
- Auth failures and MFA challenges are never retried; all retries now bounded (5 attempts)
- A 401 retries once with freshly renewed tokens before raising
NotAuthorizedException - No blocking network I/O in the constructor or on the event loop (Cognito calls run in a worker thread)
Fixes
EvnexUserDetail.nameoptional: accounts with no name set validate again (#108)- v3 connector meter exposes
supplyActivePower(CT clamp grid draw) (#109) - Insights accept the
carbonUsageattribute
Internals
- First test suite: auth/refresh/MFA/retry paths, with blockbuster guarding against event-loop blocking; runs in CI
- All dependencies upgraded (#110)