* Update device_tracker.py
From time to time, Swisscom Internet Box fails to respond and this causes an exception, which is currently not handled by the code:
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/device_tracker/setup.py", line 164, in async_device_tracker_scan
found_devices = await scanner.async_scan_devices()
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/swisscom/device_tracker.py", line 46, in scan_devices
self._update_info()
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/swisscom/device_tracker.py", line 67, in _update_info
data = self.get_swisscom_data()
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/swisscom/device_tracker.py", line 83, in get_swisscom_data
request = requests.post(url, headers=headers, data=data, timeout=10)
File "/srv/homeassistant/lib/python3.7/site-packages/requests/api.py", line 116, in post
return request('post', url, data=data, json=json, **kwargs)
File "/srv/homeassistant/lib/python3.7/site-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/srv/homeassistant/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/srv/homeassistant/lib/python3.7/site-packages/requests/sessions.py", line 686, in send
r.content
File "/srv/homeassistant/lib/python3.7/site-packages/requests/models.py", line 828, in content
self._content = b''.join(self.iter_content(CONTENT_CHUNK_SIZE)) or b''
File "/srv/homeassistant/lib/python3.7/site-packages/requests/models.py", line 757, in generate
raise ConnectionError(e)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='192.168.1.1', port=80): Read timed out.
I've just added a try-except around the post.
* Update device_tracker.py
Addressed blank line issue reported by flake8
* Update device_tracker.py
Fixed alignment to be Black compliant.
* Update device_tracker.py
Fixed one more alignment issue
* Consolidate
* Fix tests
* Update imports
* Fix import
* Use importlib because integration and package share name
* Fix more tests
* Update .coveragerc and CODEOWNERS