tchellomello / python-arlo

Python Arlo is a library written in Python 2.7/3x that exposes the Netgear Arlo cameras as Python objects.
GNU Lesser General Public License v3.0
100 stars 35 forks source link

Fixes AttributerError when requests failed to get a response #76

Closed tchellomello closed 6 years ago

tchellomello commented 6 years ago

Fixes AttributerError when requests failed to get a response

2018-06-04 23:26:42 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/homeassistant/.homeassistant/custom_components/arlo.py", line 83, in hub_refresh
update_base_station=True)
File "/srv/homeassistant/lib/python3.6/site-packages/pyarlo/init.py", line 262, in update
base.update()
File "/srv/homeassistant/lib/python3.6/site-packages/pyarlo/base_station.py", line 457, in update
self._attrs = self._session.refresh_attributes(self.name)
File "/srv/homeassistant/lib/python3.6/site-packages/pyarlo/init.py", line 206, in refresh_attributes
data = self.query(url).get('data')
AttributeError: 'NoneType' object has no attribute 'get'

Fixes: https://github.com/home-assistant/home-assistant/issues/13176#issuecomment-394544654

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-1.9%) to 77.708% when pulling c846f4ff4f437773b5d6d9fe62ff8af779379a44 on fix_nonetype into 5bdc358f1fe0f18270a606ba5232b4c0e8dbafcb on master.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-1.9%) to 77.708% when pulling c846f4ff4f437773b5d6d9fe62ff8af779379a44 on fix_nonetype into 5bdc358f1fe0f18270a606ba5232b4c0e8dbafcb on master.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-1.9%) to 77.708% when pulling c846f4ff4f437773b5d6d9fe62ff8af779379a44 on fix_nonetype into 5bdc358f1fe0f18270a606ba5232b4c0e8dbafcb on master.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-1.9%) to 77.708% when pulling c846f4ff4f437773b5d6d9fe62ff8af779379a44 on fix_nonetype into 5bdc358f1fe0f18270a606ba5232b4c0e8dbafcb on master.