github jasonacox/pypowerwall v0.15.11
v0.15.11 - HTTP/2 for Tesla Owner API Calls

4 hours ago

v0.15.11 - HTTP/2 for Tesla Owner API Calls

Tesla now requires HTTP/2 for both auth.tesla.com/oauth2/v3/token and owner-api.teslamotors.com/api/1/* endpoints. Without HTTP/2, token refresh, token exchange, and all Owner API calls return 403, breaking cloud mode entirely.

Changes

  • pypowerwall/cloud/teslapy/__init__.py: Override fetch_token(), refresh_token(), and request() to use httpx with HTTP/2, falling back to requests if httpx is unavailable
  • pypowerwall/tesla_auth.py: Use httpx with HTTP/2 for _refresh_access_token() and _exchange_code(), falling back to requests
  • TLS 1.3 pinning: _httpx_auth_verify() creates an ssl.SSLContext pinned to TLS 1.3 (mirroring TeslaMate #5406), applied to all httpx Tesla endpoints
  • Session header forwarding: httpx calls now forward full session headers (Content-Type, X-Tesla-User-Agent, etc.) to match the original requests fingerprint
  • Proxy support: All httpx call sites forward self.proxies and self.trust_env from the session
  • _HTTP2Response wrapper: Makes httpx.Response compatible with existing requests.Response code paths
  • requirements.txt: httpx[http2]>=0.27.0 — the [http2] extra ensures h2 is installed

Fixes

  • Fixes 403 errors during setup flow (sitelist retrieval) — Powerwall-Dashboard #779
  • Fixes 403 errors during normal cloud-mode polling (PRODUCT_LIST, SITE_DATA, etc.)
  • Docker workaround from #317 should no longer be needed — TLS pinning is now handled at the code level

Full changelog: v0.15.10...v0.15.11

Don't miss a new pypowerwall release

NewReleases is sending notifications on new releases.