Closed xenomorpheus closed 1 year ago
Fixes in error checking. Code simplification by removing "else" statement after terminal statement.
Thanks for this - I'm currently (very slowly) working on a request to add the AlphaESS integration into core home assistant. As I'm far from a python expert I'd prefer to get that completed before accepting any code that I'm not personally familiar with.
I'm going to leave this pull request open until then.
Hi Charles.
A huge thank you for your explanation and your extremely useful code. I didn't even know it was possible to get data from AlphaEss. You have certainly helped me a great deal.
Today I am attempting to use derived code to optimally charge my electric car.
I've done a few code clean-ups, and refactors. I will be pushing a few updates in my fork.
A couple of code pointers.
I feel that there is a bug in the error checking used in about 4 places.
if "info" in json_response and json_response["info"] != "Success":
I feel it should be ...
if "info" not in json_response or json_response["info"] != "Success":
Another pointer, is code can be simplified by removing the "else" statement when following a "terminal statement" such as "return" or "throw". Also saves indenting the code.
Again thank you for your git repo. Massive help to me.
Closing as no longer required, this data is now in the main library
Thanks for the added functionality @CharlesGillanders . I (we) really appreciate your efforts. I've been able to use python to run an edited version of the apitest.py to set/adjust my charge periods. Now to make it work from homeassistant . Then automate based on solar forecast Many thanks
… near real-time data from the battery.
Tested on Smile-5. Values look to match Alpha ESS Monitoring portal.