jesserizzo / envoy_reader

MIT License
37 stars 26 forks source link

Which version of requests-async should be used? #6

Closed gtdiehl closed 5 years ago

gtdiehl commented 5 years ago

I have tried to run the latest envoy_reader.py with the new async stuff and am unable to run it.

This is the error I am having:

Enter the Envoy IP address or host name, or press enter to use 'envoy' as default: 10.0.40.209 Reading... Traceback (most recent call last): File "envoy_reader.py", line 261, in <module> TESTREADER.run_in_console() File "envoy_reader.py", line 241, in run_in_console self.inverters_production())) File "C:\Users\Greg\AppData\Local\Programs\Python\Python37\lib\asyncio\base_events.py", line 573, in run_until_complete return future.result() File "envoy_reader.py", line 118, in daily_production raw_json = await self.call_api() File "envoy_reader.py", line 66, in call_api await self.detect_model() File "envoy_reader.py", line 38, in detect_model if response.status_code == 200: AttributeError: 'coroutine' object has no attribute 'status_code'

I had to install the requests-async package. I grabbed the latest which is v0.6.0. Is this the correct version?

Thank you Greg

gtdiehl commented 5 years ago

I see what the issue is, there is no await for the requests.get(...) on Line 36. I'll open a PR.