Making this change as Home Assistant does not want I/O to occur when updating entities.
This change makes it so where the getData() method will retrieve the data, and the other methods will only retrieve what is stored in variables.
Changes that I made at a high-level:
HTTP requests to Envoys with firmware <3.9 was moved to getData(). Other firmwares the HTTP requests (except for Inverter data gathering) was already moved to getData()
Move Inverter gathering to getData()
To support gathering Inverter data I added an optional parameter for the EnvoyReader constructor. So that if Home Assistant config does not have inverters then this can be skipped.
Removed detect_model() methods from individual methods and runs only from getData()
Removed isDataRetrieved boolean, as this is not used
Fix #54
Making this change as Home Assistant does not want I/O to occur when updating entities.
This change makes it so where the getData() method will retrieve the data, and the other methods will only retrieve what is stored in variables.
Changes that I made at a high-level:
getData()
. Other firmwares the HTTP requests (except for Inverter data gathering) was already moved togetData()
getData()
inverters
then this can be skipped.detect_model()
methods from individual methods and runs only fromgetData()
isDataRetrieved
boolean, as this is not used