🏡 Open source home automation that puts local control and privacy first.
Find a file
LeoCal bc53e9d0c8 Fix unhandled exception when Swisscom Internet Box is not responsive (#28618)
* 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
2019-11-08 11:01:35 -08:00
.devcontainer Update devcontainer.json 2019-10-17 17:06:33 +02:00
.github Update documentation link URL for integrations (part2) (#27117) 2019-10-02 09:34:07 -07:00
.vscode Always run flake8 through pre-commit, and with doctests (#28490) 2019-11-06 21:38:00 +02:00
docs fixed minor typo in docs/source/api/helpers.rst (#27282) 2019-10-07 10:25:36 -07:00
homeassistant Fix unhandled exception when Swisscom Internet Box is not responsive (#28618) 2019-11-08 11:01:35 -08:00
script Always run flake8 through pre-commit, and with doctests (#28490) 2019-11-06 21:38:00 +02:00
tests Add TT WS API (#28599) 2019-11-08 10:06:16 +01:00
.codecov.yml Only comment with changed coverage on release PRs [skip-ci] (#23224) 2019-04-18 20:58:35 -07:00
.coveragerc Add azure servicebus notify service (#27566) 2019-11-07 14:47:44 +01:00
.dockerignore Docker cleanup. (#8226) 2017-06-30 08:07:33 -07:00
.gitattributes Fix line endings [skipci] (#12333) 2018-02-11 23:07:28 -08:00
.gitignore Move imports in wake_on_lan component (#28100) 2019-10-22 23:14:52 -07:00
.hound.yml Add .hound.yml 2016-11-13 11:34:09 -08:00
.ignore Include .ignore file for search utilities (#5290) 2017-01-16 22:52:53 -08:00
.pre-commit-config-all.yaml Reduce test requirements duplication, sync flake8 and related (#28538) 2019-11-04 21:21:52 -08:00
.pre-commit-config.yaml Reduce test requirements duplication, sync flake8 and related (#28538) 2019-11-04 21:21:52 -08:00
.readthedocs.yml Rename readthedocs file (#17718) 2018-10-23 17:39:17 +02:00
.travis.yml Parallelize pylint everywhere (#28149) 2019-10-23 13:18:41 -07:00
azure-pipelines-ci.yml Update azure-pipelines-ci.yml 2019-11-05 21:58:35 +01:00
azure-pipelines-release.yml Update azure-pipelines-release.yml for Azure Pipelines 2019-09-30 14:49:08 +02:00
azure-pipelines-translation.yml Update azure-pipelines-translation.yml for Azure Pipelines 2019-09-05 12:09:21 +02:00
azure-pipelines-wheels.yml Update azure-pipelines-wheels.yml for Azure Pipelines 2019-10-14 14:30:08 +02:00
CLA.md Update LICENSE.md and CLA.md to reflect the new Apache 2.0 license 2017-01-28 12:12:34 -08:00
CODE_OF_CONDUCT.md Add organization docs 2017-01-22 16:21:20 -08:00
CODEOWNERS Add azure servicebus notify service (#27566) 2019-11-07 14:47:44 +01:00
CONTRIBUTING.md Update developer doc links to developers.home-assistant.io (#16622) 2018-09-15 13:27:37 +02:00
Dockerfile.dev Fix dev dockerfile 2019-11-05 21:38:30 +01:00
LICENSE.md Update license to official GitHub template (#16470) 2018-09-07 10:11:51 +02:00
MANIFEST.in Consolidate frontend (#9915) 2017-10-24 19:36:27 -07:00
pylintrc Add additional support over NC (#28527) 2019-11-05 22:39:15 +01:00
pyproject.toml Add Black 2019-07-31 12:23:23 -07:00
README.rst Update documentation link URL for integrations (part2) (#27117) 2019-10-02 09:34:07 -07:00
requirements_all.txt Bump ZHA quirks version (#28636) 2019-11-08 09:12:50 -08:00
requirements_docs.txt Upgrade Sphinx to 2.1.2 (#24693) 2019-06-23 07:49:40 +02:00
requirements_test.txt Reduce test requirements duplication, sync flake8 and related (#28538) 2019-11-04 21:21:52 -08:00
requirements_test_all.txt Bump ZHA quirks version (#28636) 2019-11-08 09:12:50 -08:00
requirements_test_pre_commit.txt Reduce test requirements duplication, sync flake8 and related (#28538) 2019-11-04 21:21:52 -08:00
setup.cfg Always run flake8 through pre-commit, and with doctests (#28490) 2019-11-06 21:38:00 +02:00
setup.py Upgrade jinja2 to >=2.10.3 (#28422) 2019-11-04 09:57:20 +01:00
tox.ini Don't fail tox pylint if PYLINT_ARGS is not set (#28403) 2019-11-04 08:12:15 +01:00

Home Assistant |Chat Status|
=================================================================================

Home Assistant is a home automation platform running on Python 3. It is able to track and control all devices at home and offer a platform for automating control.

To get started:

.. code:: bash

    python3 -m pip install homeassistant
    hass --open-ui

Check out `home-assistant.io <https://home-assistant.io>`__ for `a
demo <https://home-assistant.io/demo/>`__, `installation instructions <https://home-assistant.io/getting-started/>`__,
`tutorials <https://home-assistant.io/getting-started/automation-2/>`__ and `documentation <https://home-assistant.io/docs/>`__.

|screenshot-states|

Featured integrations
---------------------

|screenshot-components|

The system is built using a modular approach so support for other devices or actions can be implemented easily. See also the `section on architecture <https://developers.home-assistant.io/docs/en/architecture_index.html>`__ and the `section on creating your own
components <https://developers.home-assistant.io/docs/en/creating_component_index.html>`__.

If you run into issues while using Home Assistant or during development
of a component, check the `Home Assistant help section <https://home-assistant.io/help/>`__ of our website for further help and information.

.. |Chat Status| image:: https://img.shields.io/discord/330944238910963714.svg
   :target: https://discord.gg/c5DvZ4e
.. |screenshot-states| image:: https://raw.github.com/home-assistant/home-assistant/master/docs/screenshots.png
   :target: https://home-assistant.io/demo/
.. |screenshot-components| image:: https://raw.github.com/home-assistant/home-assistant/dev/docs/screenshot-components.png
   :target: https://home-assistant.io/integrations/