jesserizzo / envoy_reader

MIT License
37 stars 26 forks source link

Replace sync inverter call with async #29

Closed gtdiehl closed 4 years ago

gtdiehl commented 4 years ago

Home Assistant 0.109 is now checking if I/O is occurring within the event loop and then logging a Warning message. This message is occurring with the envoy sensor due to the requests_sync call that is called from an async HA call

I was unable to get the currently used requests_async library or the preferred HTTP library of aiohttp to work with HTTP Digest Authentication. So I changed the inverters_production() method to use the httpx library

Fixes #28

jesserizzo commented 4 years ago

@gtdiehl Can you please drop a good version of httpx in the requirements.txt file

gtdiehl commented 4 years ago

@jesserizzo Added the latest stable released version of httpx to the requirements.txt file. I also removed the import of the requests library as well removed it from the requirements.txt file, as it seemed the only method using the requests library was inverters_production()

jesserizzo commented 4 years ago

@gtdiehl Yes I believe I used requests on inverters_production because async_requests didn't support the authentication needed. Everything else should have already been using async_requests if I remember correctly.

balloob commented 4 years ago

@jesserizzo would you be able to publish a new release so we can update Home Assistant?

jesserizzo commented 4 years ago

@balloob Done, version 0.16.0