v0.15.6 - CLI Redesign
Reserve Percent Scaling Fix + CLI Redesign
- Fix:
set_operation()reserve percent scaling — reverse Tesla App scaling (0–100%) to raw API scale (5–100%) only in TEDAPI v1r mode, avoiding incorrect round-trip values in cloud and FleetAPI modes - Fix: Correctly handle
level=0inset_reserve()vialevel is not Nonecheck - Fix: Revert universal scaling from
set_operation(); move raw conversion intoPyPowerwallTEDAPI.post_api_operation()where it belongs - Fix: FleetAPI
get_api_system_status_soe()was returningbattery_level()(Tesla App-scaled, 0–100% usable) directly as the raw SOE percentage — missing the reverse-scaling applied by the cloud backend. This causedlevel()(defaultscale=False) to return the already-scaled app value instead of the physical percentage, making FleetAPI SOC appear ~2% lower than v1r/TEDAPI for the same battery. Fix: applysoe = (percentage_charged + 5/0.95) * 0.95to convert app scale → raw, matching the cloud backend. - Fix:
getcommand now reports SOC usinglevel(scale=True)— matching the Tesla app display (usable capacity, 0–100% of non-reserved energy) rather than the raw physical percentage including Tesla's 5% buffer reserve. - Fix: FleetAPI config validation in
Powerwall.__init__()— changedos.access(file, W_OK)check (fails when file doesn't exist) to check directory writability when config file is absent, preventing spuriousPyPowerwallInvalidConfigurationParameteron first-time setup - Feat: CLI (
python -m pypowerwall) redesigned for consistency across all connection modes- Replace string
-modeflag onget(which clashed withset -mode) with explicit boolean connection flags:-local,-cloud,-fleetapi,-tedapi,-v1r— available on bothgetandset - Backward compat:
get -mode <value>still accepted with a deprecation warning; e.g.get -mode v1rbehaves identically toget -v1r - Add
-host,-password,-gw_pwd,-rsa_key_pathcredential flags togetandsetsubcommands - Add global
-debugand-authpathflags (via shared parent parser) available to every subcommand setupsubcommand now handles all auth flows: default/-cloud(Tesla Owners API),-fleetapi(Fleet API wizard),-v1r(RSA key registration) — replacing the now-deprecatedfleetapitop-level commandgetoutput expanded: addsfirmware,grid_status, andtime_remainingfields;Nonevalues display asN/Ain text/CSV output- Pre-flight checks in
getandset: if-cloudor-fleetapiis specified but the required config file is missing, a clear error message with setup instructions is printed before any connection attempt - Connection check (
is_connected()) now runs before the output banner — no partial output on failure fleetapitop-level command shows deprecation warning and points tosetup -fleetapi;logincommand shows deprecation warning and exits
- Replace string
- Docs: Update
README.mdCLI section — new command list with global flags, connection mode flag reference table, examples for all 5 connection modes, updated setup commands (fleetapi→setup -fleetapi,setup -v1r) - Release prep:
- Bump library version to
0.15.6 - Update proxy pinned dependency to
pypowerwall==0.15.6
- Bump library version to
What's Changed
- fix(security): 2 improvements across 2 files by @tomaioo in #291
- fix: reverse Tesla App scaling in set_operation() for reserve percent by @jasonacox-sam in #293
- CLI Redesign by @jasonacox in #294
New Contributors
Full Changelog: v0.15.5...v0.15.6