core/tests
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
..
auth Merge multiple context managers in tests (#48146) 2021-03-27 09:17:15 +01:00
components Add syncthing integration (#38331) 2021-05-08 19:12:14 +02:00
fixtures Bump `gios` library (#50145) 2021-05-07 13:03:11 +02:00
hassfest Throw error in hassfest when integration is missing version (#45976) 2021-02-04 13:31:17 +01:00
helpers Migrate from pytz to python-dateutil (#49643) 2021-05-07 22:46:26 -07:00
mock Disable strict type checks for tests (#49851) 2021-04-29 15:57:02 +02:00
resources
scripts Cleanup unused loggers (#46510) 2021-02-14 13:46:58 +01:00
test_util Detach aiohttp.ClientSession created by config entry setup on unload (#48908) 2021-04-09 10:14:33 -07:00
testing_config Add color_mode support to group light (#50165) 2021-05-06 22:34:51 -07:00
util Migrate from pytz to python-dateutil (#49643) 2021-05-07 22:46:26 -07:00
__init__.py
bandit.yaml
common.py Migrate from pytz to python-dateutil (#49643) 2021-05-07 22:46:26 -07:00
conftest.py Wait for registries to load at startup (#46265) 2021-02-11 17:36:19 +01:00
ignore_uncaught_exceptions.py
test_bootstrap.py Avoid sending empty integration list multiple times during subscribe_bootstrap_integrations (#49181) 2021-04-15 23:16:17 -07:00
test_config.py Migrate from pytz to python-dateutil (#49643) 2021-05-07 22:46:26 -07:00
test_config_entries.py Allow passing options in config flow entry creation (#49912) 2021-05-05 22:14:01 -07:00
test_core.py Migrate from pytz to python-dateutil (#49643) 2021-05-07 22:46:26 -07:00
test_data_entry_flow.py Use config_entries.SOURCE_* constants (#49631) 2021-04-25 11:27:40 +02:00
test_exceptions.py Refine printing of ConditionError (#46838) 2021-02-21 14:54:36 +01:00
test_loader.py Add warning to custom integrations without version (#45919) 2021-02-04 09:59:41 +01:00
test_main.py
test_requirements.py Fix deadlock in async_get_integration_with_requirements after failed dep pip install (#49540) 2021-04-22 22:32:38 +02:00
test_runner.py Ensure shutdown does not deadlock (#49282) 2021-04-18 08:55:51 -10:00
test_setup.py Replace http startup logic with async_when_setup_or_start (#48784) 2021-04-13 14:10:58 -07:00