🏡 Open source home automation that puts local control and privacy first.
Find a file
Gleb Sinyavskiy 97eb4c6c62
Add syncthing integration (#38331)
* Scaffold the integration

* Add config flow data schema

* Handle configuration errors

* Get folder states

* Support https

* Fix translations

* Listen to syncthing events in a separate thread

* Bump syncthing

* Automatically reconnect to the syncthing server

* Renames

* Improve loading and unloading

* Update folder states from events

* Refactoring, handle FolderPaused event

* Dynamic folder icons

* Refactoring

* Mark folders as unavailable when senrver is unavailable

* Update folder satus when server is available

* Raise PlatformNotReady

* Implement additional polling

* Stop polling when the server is not available

* Minor fixes

* Remove logging

* Check name uniqueness

* Refactoring

* Minor refactorings

* Bump python-syncthing

* Migrate to aiosyncthing

* Minor fixes

* Update .coveragerc

* Set quality scale

* Bump aiosyncthing, properly handle invalid token

* Fix logging

* Fix logging

* Use CONF_VERIFY_SSL from homeassistant.const

* Bump aiosyncthing. Add Syncthing device

* Fix device name

* Bump aiosyncthing

* Bump aiosyncthing

* Extract SyncthingClient

* Add folder to device_state_attributes

* Do not pass the loop

* Cover config_flow.py

* Move self.async_create_entry outside of the try block

* Raise ConfigEntryNotReady if syncthing server is not reachable

* Fix already configured error message

* Change default name to Syncthing

* Bump aiosyncthing

* Fix formatting

* Fix formatting

* Fix tests

* Fix typo, use lis comprehension

* Fix typo, remove unused CONFIG_SCHEMA

* Bump aiosyncthing

* Remove periods from log messages W0001

* Fix tests

* Black, isort

* Remove empty items from manifest.json

* Fix variable naming

* Remove async_setup

* Use SensorEntity

* Use asyncio.create_task instead of self._hass.loop.create_task

* Do not pass hass to FolderSensor initializer

* Rename device_state_attributes to extra_state_attributes

* Use callbacks

* Simplify tests

* Refactor _listen()

* Use url for the title

* Use the url instead of the name to identify the config entry

* Explicitly set sensor attributes, extract _filter_state

* Use server url instead of name in device_info

* Use server url instead of name in logs

* User server id as a device identifier

* Use URL instead of name to identify config entry

* Use shortened server id instead of name to build entity name and unique id

* Do not use CONF_NAME

* Cleanup unused strings

* Cleanup unused strings

* Add IOT class

* Scaffold the integration

* Add config flow data schema

* Handle configuration errors

* Get folder states

* Support https

* Fix translations

* Listen to syncthing events in a separate thread

* Bump syncthing

* Automatically reconnect to the syncthing server

* Renames

* Improve loading and unloading

* Update folder states from events

* Refactoring, handle FolderPaused event

* Dynamic folder icons

* Refactoring

* Mark folders as unavailable when senrver is unavailable

* Update folder satus when server is available

* Raise PlatformNotReady

* Implement additional polling

* Stop polling when the server is not available

* Minor fixes

* Remove logging

* Check name uniqueness

* Refactoring

* Minor refactorings

* Bump python-syncthing

* Migrate to aiosyncthing

* Minor fixes

* Update .coveragerc

* Set quality scale

* Bump aiosyncthing, properly handle invalid token

* Fix logging

* Fix logging

* Use CONF_VERIFY_SSL from homeassistant.const

* Bump aiosyncthing. Add Syncthing device

* Fix device name

* Bump aiosyncthing

* Bump aiosyncthing

* Extract SyncthingClient

* Add folder to device_state_attributes

* Do not pass the loop

* Cover config_flow.py

* Move self.async_create_entry outside of the try block

* Raise ConfigEntryNotReady if syncthing server is not reachable

* Fix already configured error message

* Change default name to Syncthing

* Bump aiosyncthing

* Fix formatting

* Fix formatting

* Fix tests

* Fix typo, use lis comprehension

* Fix typo, remove unused CONFIG_SCHEMA

* Bump aiosyncthing

* Remove periods from log messages W0001

* Fix tests

* Black, isort

* Remove empty items from manifest.json

* Fix variable naming

* Remove async_setup

* Use SensorEntity

* Use asyncio.create_task instead of self._hass.loop.create_task

* Do not pass hass to FolderSensor initializer

* Rename device_state_attributes to extra_state_attributes

* Use callbacks

* Simplify tests

* Refactor _listen()

* Use url for the title

* Use the url instead of the name to identify the config entry

* Explicitly set sensor attributes, extract _filter_state

* Use server url instead of name in device_info

* Use server url instead of name in logs

* User server id as a device identifier

* Use URL instead of name to identify config entry

* Use shortened server id instead of name to build entity name and unique id

* Do not use CONF_NAME

* Cleanup unused strings

* Cleanup unused strings

* Add IOT class

* Apply suggestions from code review

* Clean up

* Fix dict comprehension

* Clean sensor

* Use the server ID as a config entry unique ID

* Remove the AlreadyConfigured exception

* Clean up old error string

* Format json

* Convert sensor attributes to snake case

* Force CI

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-05-08 19:12:14 +02:00
.devcontainer Call setup during devcontainer create (#46224) 2021-02-08 16:16:40 +01:00
.github Bump codecov/codecov-action from v1.4.1 to v1.5.0 (#50061) 2021-05-04 10:57:44 +02:00
.vscode Allow debugging of integration dependancies (#49211) 2021-04-14 19:26:37 +02:00
docs Remove Travis CI config (#44443) 2020-12-22 13:49:42 +01:00
homeassistant Add syncthing integration (#38331) 2021-05-08 19:12:14 +02:00
machine Remove DHT from Raspberry Pi machine builds (#49829) 2021-04-28 22:43:40 +02:00
pylint/plugins Have pylint warn when user visible log messages do not start with capital letter or end with a period (#48064) 2021-03-19 09:26:36 -05:00
rootfs Update base image to version 2021.04.3 (#49817) 2021-04-28 18:03:21 +02:00
script Improve type annotations for Airly integration (#49898) 2021-05-07 09:47:52 -05:00
tests Add syncthing integration (#38331) 2021-05-08 19:12:14 +02:00
.coveragerc Add syncthing integration (#38331) 2021-05-08 19:12:14 +02:00
.dockerignore Integrate dockerbuild (#33168) 2020-03-23 00:39:37 +01:00
.gitattributes highlight Dockerfile.dev as Dockerfile in github ui (#36933) 2020-06-22 14:45:57 +02:00
.gitignore Fix too agressive .gitignore (#41677) 2020-10-12 16:48:42 +02:00
.hadolint.yaml Add hadolint to CI (#34758) 2020-04-27 12:09:31 +02:00
.ignore Include .ignore file for search utilities (#5290) 2017-01-16 22:52:53 -08:00
.pre-commit-config.yaml Upgrade pyupgrade to v2.14.0 (#50059) 2021-05-05 09:28:47 +02:00
.prettierignore Rename translations dir for integrations (#34494) 2020-04-21 16:11:05 -07:00
.readthedocs.yml Drop remaining Python < 3.8 support (#44743) 2021-01-04 11:47:29 +01:00
.strict-typing Improve type annotations for Airly integration (#49898) 2021-05-07 09:47:52 -05:00
.yamllint Add yamllint (in pre-commit and CI) (#33676) 2020-04-05 10:33:45 +02:00
azure-pipelines-ci.yml Revert "Update azure-pipelines-ci.yml to enable black mode in isort" (#45390) 2021-01-21 11:01:22 +01:00
azure-pipelines-translation.yml Drop remaining Python < 3.8 support (#44743) 2021-01-04 11:47:29 +01:00
azure-pipelines-wheels.yml Adjust GRPC wheel build (#50119) 2021-05-05 20:12:06 -07:00
build.json Update base image to version 2021.04.3 (#49817) 2021-04-28 18:03:21 +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 Update Code of Conduct to 2.0 (#36142) 2020-05-25 19:40:40 -04:00
codecov.yml Update Codecov.io configuration (#33783) 2020-04-07 09:01:01 -07:00
CODEOWNERS Add syncthing integration (#38331) 2021-05-08 19:12:14 +02:00
CONTRIBUTING.md Use core GitHub URL in contributing guidelines (#41083) 2020-10-02 20:42:33 +02:00
Dockerfile Increase timeout to avoid killing the core during shutdown (#45029) 2021-01-11 11:24:02 +01:00
Dockerfile.dev Install requirements.txt while building dev Dockerfile (#48268) 2021-03-23 14:04:15 -07: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
mypy.ini Improve type annotations for Airly integration (#49898) 2021-05-07 09:47:52 -05:00
pyproject.toml Update pylint to 2.8.0 (#49637) 2021-04-24 14:39:24 -10:00
README.rst Update README.rst to avoid redirects (#44519) 2020-12-26 10:05:41 +01:00
requirements.txt Migrate from pytz to python-dateutil (#49643) 2021-05-07 22:46:26 -07:00
requirements_all.txt Add syncthing integration (#38331) 2021-05-08 19:12:14 +02:00
requirements_docs.txt Refactor API documentation (#33217) 2020-03-25 13:21:04 -07:00
requirements_test.txt Upgrade pytest to 6.2.4 (#50077) 2021-05-04 20:43:41 +02:00
requirements_test_all.txt Add syncthing integration (#38331) 2021-05-08 19:12:14 +02:00
requirements_test_pre_commit.txt Upgrade pyupgrade to v2.14.0 (#50059) 2021-05-05 09:28:47 +02:00
setup.cfg Don't ignore mypy errors by default (#49270) 2021-04-26 14:23:21 +02:00
setup.py Migrate from pytz to python-dateutil (#49643) 2021-05-07 22:46:26 -07:00
tox.ini Fix local mypy workflow (#48433) 2021-03-30 17:18:29 +02:00

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

Open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server.

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/>`__ 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/architecture_index/>`__ and the `section on creating your own
components <https://developers.home-assistant.io/docs/creating_component_index/>`__.

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/