tdorssers / TeslaPy

A Python module to use the Tesla Motors Owner API
MIT License
374 stars 83 forks source link

Powerwall function get_battery_data not working #152

Open gmcluhan opened 1 year ago

gmcluhan commented 1 year ago

As of October 5, 2023 it appears the get_battery_data function isn't working anymore.

Traceback (most recent call last):
  File "/Users/blah/Documents/powerwall_health.py", line 42, in <module>
    battery_info = powerwall[0].get_battery_data()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/teslapy/__init__.py", line 793, in get_battery_data
    self.update(self.api('BATTERY_DATA')['response'])
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/teslapy/__init__.py", line 713, in api
    return self.tesla.api(name, pathvars, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/teslapy/__init__.py", line 369, in api
    return self.request(endpoint['TYPE'], uri, serialize,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/teslapy/__init__.py", line 158, in request
    response.raise_for_status()  # Raise HTTPError, if one occurred
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests/models.py", line 960, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://owner-api.teslamotors.com/api/1/powerwalls/STE20220125-00244
gmcluhan commented 1 year ago

I see that function has been removed from the code base. It would be good to update the documentation that this has been removed. Along with that documentation it would be great to see how to use get_site_info() and get_site_data() as I think those are the replacements.