CharlesGillanders / alphaess

This Python library logs in to www.alphaess.com and retrieves data on your Alpha ESS inverter, photovoltaic panels, and battery if you have one.
MIT License
22 stars 9 forks source link

Grab settings #6

Closed matt-oneill closed 1 year ago

matt-oneill commented 2 years ago

Hi Charles, I have added a postman collection to see the returned data from the api calls, for the settings it doesn't appear to return an array, but there is an endpoint GetCustomUseESSList (similar to GetCustomMenuESSList) which returns an array, and then the subsequent call to GetCustomUseESSSetting uses system_id from the prior. I don't know why this api would use the system_id and not the sys_sn as in others, but it does. To get around this there is an internal system_id_for_sn to make the conversion for the settings call given the sys_sn. I hope this will help to make it work for all cases with people with multiple systems. Renamed & refactored a couple internal methods to differentiate between the generic post & get data