Open gregrahn opened 2 months ago
Great find @gregrahn !!! Wow, that is bad. I don't have a car, so my tests were passing. Would you be willing to submit a PR? I want you to get credit for this great work.
I'll combine this with #112 for a hotfix release.
Thanks for your help with this @gregrahn !
In trying to get pypowerwall to use the fleet API I experienced several errors that I've tracked down.
When pypowerwall calls
/api/1/products
it returns both a car and power product for me like below (shorted and redacted). Because the car details do not contain a keyenergy_site_id
, code that assumes this key exists throws a KeyError exception, and never gets to checksites[1]
so an additional check is needed for that.Also, I noticed that in trying to get the setup completed through some hacking, the
site_id
in.pypowerwall.fleetapi
was stored as a string, not a number. This causes comparison checks to fail given the API for products returnsenergy_site_id
as a number.Once I changed
site_id
in.pypowerwall.fleetapi
to be a number and added a key check, it worked as expected.Shorted
/api/1/products
response:Key check