jasonacox / pypowerwall

Python API for Tesla Powerwall and Solar Power Data
MIT License
120 stars 21 forks source link

Possible FleetAPI bug in __main__.py #93

Closed darroni closed 1 month ago

darroni commented 1 month ago

The latest pypowerwall (0.9) appears to have a bug in the #Get Powerwall Mode section. When running in Cloud Mode with no FleetAPI configured, pypowerwall returns an exception on line 152:

  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/home/darroni/myenv/lib/python3.12/site-packages/pypowerwall/__main__.py", line 152
    'site_id': pw.client.fleet.site_id
               ^^^^^^^^^^^^^^^^^^^^^^^

It looks like it's trying to force the site.id to the fleet.site_id. I simply changed the variable to None, per your documentation and it solved the problem.

image

jasonacox commented 1 month ago

Great find @darroni ! It also uncovered another bug. Thank you. I'll push out a patch.