github jasonacox/pypowerwall v0.16.4
v0.16.4 - TEDAPI Auto-Recovery Wedge Fix

3 hours ago

v0.16.4 - TEDAPI Auto-Recovery Wedge Fix

Library Fix

  • fix: Powerwall.connect() now restores tedapi/tedapi_mode along with mode/cloudmode/fleetapi when all connection modes fail. Previously a fully-failed connect(retry=False) left tedapi=False behind (the local-mode fallback handler zeroes it), which permanently wedged the proxy's TEDAPI auto-recovery thread — its pw.tedapi gate short-circuited every iteration, so no further recovery attempt was ever made until restart. (#366)

Proxy Hardening (t98 → t99)

  • fix: The TEDAPI recovery loop now checks fallback state before the pw.tedapi gate. Once in fallback, recovery can never be short-circuited by a falsy pw.tedapi, making this class of wedge structurally impossible even if some future path corrupts the attribute again. Healthy-path behavior is unchanged (non-TEDAPI modes still skip probing).
  • feat: /health and /stats fallback_mode blocks now include next_attempt_at (timestamp the next recovery attempt is due) and recovery_thread_alive (Thread.is_alive() of the recovery thread), so a stalled recovery is directly visible instead of inferred from a frozen counter.
  • fix: next_attempt_at is now floored by TEDAPI_PROBE_INTERVAL — the recovery loop always sleeps the probe interval before attempting, so the real due time is max(recovery_interval, TEDAPI_PROBE_INTERVAL).

Docs

  • docs(proxy): Maintenance-mode deprecation notice for pypowerwall-server. The proxy is not being removed and keeps receiving critical/security fixes, but new feature development (multi-gateway naming, MQTT, etc.) is moving to pypowerwall-server. (#368)

Tests

356 passed (pytest -m "not live"). Library restore regression, recovery-loop gate regression, next_attempt_at scheduling, and healthy-gate preservation tests added. Live wedge test validated against an isolated container — forced route-loss reproduced the #366 sequence (fallback → fully-failed attempt #1 → route restored → attempt #2 fired and recovered).


Contributors

Thanks to the community members who made this release possible:

  • @dthorndyke — reported and diagnosed the TEDAPI auto-recovery wedge with an exceptional bug report (#366): nine tracked events with timestamps, /health field values, and a root-cause hypothesis that turned out to be exactly right
  • @jasonacox — authored and merged the library fix, proxy hardening, observability improvements (#367), and the maintenance-mode deprecation notice (#368)

— Sam ⚡

Don't miss a new pypowerwall release

NewReleases is sending notifications on new releases.