Skip to content

v0.8.0

Choose a tag to compare

@aaearon aaearon released this 09 May 07:10
· 9 commits to main since this release

[0.8.0] — 2026-05-09

Added

  • Module-level loggers (aioratio.auth, aioratio.client, aioratio.token_store,
    aioratio._transport) emit DEBUG-level events for login, refresh, 401 retry,
    rate-limit hits, and HTTP failures. No credentials, tokens, or device passwords
    are ever logged. Note the transport logger uses the leading-underscore module
    name because the module is private (aioratio._transport).
  • RatioApiError.status attribute carries the originating HTTP status code
    (or None if the error was not raised from an HTTP response). Existing
    call sites that construct RatioApiError("...") keep working unchanged.
  • __version__ is now exported from the top-level aioratio package.

Changed

  • BREAKING: cpms_options(serial) now only returns [] for HTTP 403/404
    responses; other transport failures (5xx, rate-limit, malformed JSON) now
    propagate as RatioApiError / RatioRateLimitError instead of being
    silently swallowed. Callers that relied on the empty-list fallback for
    non-403/404 errors must add explicit error handling.
    The downstream
    home-assistant-ratio integration already wraps this call in its own
    per-call try/except in the coordinator, so HACS users do not need to act.
  • ScheduleSlot.to_dict() now validates start/end strings against
    ^(?:[01]?\d|2[0-3]):[0-5]\d$ and raises a clear ValueError. The previous
    behaviour was to fail later inside int(...) with a confusing trace.
    Both zero-padded (07:00) and single-digit-hour (7:00) forms are
    accepted so direct callers aren't BC-broken.
  • Tightened _CloudTransport.request() and _get_settings() return
    annotations from Any to dict[str, Any] | list[Any] | None /
    dict[str, Any] | None for stronger downstream type-checking.
  • RatioClient.user_id() now caches the decoded sub claim per ID token,
    skipping the JWT base64-decode + JSON parse on every authenticated call.
    (The underlying auth.get_access_token() still loads the token store as
    before; only the parse is cached.)
  • Dependency: aiohttp>=3.9,<5 (previously unbounded upper).

Internal

  • Added [tool.ruff] config and applied auto-fixable lint/format pass.
  • Added .pre-commit-config.yaml for ruff + mypy + standard hygiene hooks.
  • Removed unreachable Python 3.10 typing fallbacks (package is >=3.11).
  • Added regression coverage for cpms_options 403/404/5xx/no-status branches.