webdjoe / pyvesync

pyvesync is a python library to manage Etekcity & Levoit smart devices
MIT License
170 stars 78 forks source link

HTTPSConnectionPool: Read timed out leads to AttributeError in get_details #80

Closed provinzio closed 3 years ago

provinzio commented 3 years ago

I am using pyvesync in an home assisstant integration. I am regularly seeing following in my log file and assume that it's an bug in pyvesync.

2021-05-06 13:31:24 WARNING (SyncWorker_3) [pyvesync.helpers] HTTPSConnectionPool(host='smartapi.vesync.com', port=443): Read timed out. (read timeout=5)
2021-05-06 13:31:24 ERROR (MainThread) [homeassistant.helpers.entity] Update for humidifier.lufti fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 292, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 490, in async_device_update
    raise exc
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/vesync/common.py", line 89, in update
    self.device.update()
  File "/usr/local/lib/python3.8/site-packages/pyvesync/vesyncfan.py", line 364, in update
    self.get_details()
  File "/usr/local/lib/python3.8/site-packages/pyvesync/vesyncfan.py", line 345, in get_details
    outer_result = r.get('result', {})
AttributeError: 'NoneType' object has no attribute 'get'
webdjoe commented 3 years ago

83

webdjoe commented 3 years ago

83 API Return Error - Same issues being discussed here.