Skip to content

2.7.0

Latest

Choose a tag to compare

@jandado jandado released this 03 Oct 20:10
· 1 commit to main since this release

2.7.0

Highlights

  • New per-user websocket transport (ws_user): WsUserSocketSession — one connection serves every device of the account, replacing the N per-device socket_io sessions that suffer the backend's missing pings (the Server has stopped communicating 85-second cycle). Server-side proxy PINGs supervise the session; the server cuts the socket exactly at the access token's 4 h expiry (close code 1006) and the reconnect with a fresh token is mandatory and part of the steady state.
  • check_ws_user_support() probe + WsUserUnsupportedError and the fallback doctrine: only deterministic handshake rejections signal "endpoint unsupported"; transient trouble is retried and never demotes. UpdateManager gains a ws_user_socket= kwarg so availability tracking and writes route through whichever transport is active.
  • Shared retry/backoff helpers for the REST side.
  • CLI: authentication options resolve from SMARTBOX_* environment variables and a .env file (searched upward from the working directory; precedence command line > shell > .env).
  • README rewritten: library usage, every CLI command documented, .env section, websocket transports section.

Fixes

  • .env parsing follows python-dotenv semantics: an inline # starts a comment only when it is preceded by whitespace and lies outside quotes, and quoted values unquote cleanly even when a trailing comment follows. Previously inline comments silently became part of the value (corrupting credentials written in the conventional quoted style).

Breaking

  • UpdateManager.socket_session returns None in ws_user mode (previously always a SocketSession); use the new ws_user_socket accessor to distinguish modes.

Internal

  • UpdateManager: the four identical subscribe_to_node_* bodies share one _subscribe_to_node_key implementation; public API unchanged (contract tests).
  • Socket tests for namespace callbacks, websocket cleanup, SIGINT handling and cancellation during connect; coverage floor raised to 95% (socket.py no longer excluded); ruff and mypy run over tests/ in CI.