Commit Graph
189 Commits
Author SHA1 Message Date
a7a4875f52 Add more debug details to running timeouts (#43644)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-01-04 13:10:39 +01:00
Franck NijhofandGitHub 65cf2fcb6f Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
Paulus SchoutsenandGitHub 1c9c99571e Use !input instead of !placeholder (#43820)
* Use !input instead of !placeholder

* Update input name

* Lint

* Move tests around
2020-12-01 18:21:36 +01:00
J. Nick KostonandGitHub 94bf55e29b Limit concurrency of async_get_integration to avoid creating extra threads (#43085)
* Limit concurrency of async_get_integration to avoid creating extra threads

Since async_get_integration is waiting on the disk most of the time
it would end up creating many new threads because the disk could
not deliver the data in time.

* pylint
2020-11-10 21:34:54 -10:00
67b3552165 Add more units to distance conversion util (#40181)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-11-09 11:38:15 +01:00
0fb587727c Add initial blueprint support (#42469)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2020-11-02 15:00:13 +01:00
DmitryandGitHub b106149588 Fix string parameter processing in parse_time_expression (#41468) (#41469) 2020-10-09 11:48:49 +02:00
J. Nick KostonandGitHub 8d5c124deb Improve performance of generating non-cryptographically secure uuids (#41314) 2020-10-07 16:37:01 +02:00
J. Nick KostonandGitHub e08ee282ab Abort execution of template renders that overwhelm the system (#40647) 2020-09-28 14:43:22 +02:00
J. Nick KostonandGitHub f8704a2dfc Ensure we always fire time pattern changes after microsecond 0 (#39302) 2020-08-28 16:27:25 +02:00
Franck NijhofandGitHub 1c2ebdf307 Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
Paulus SchoutsenandGitHub 51a63c1fc4 Drop last bits of asyncio.coroutine (#39280) 2020-08-26 16:57:52 +02:00
J. Nick KostonandGitHub bee6d87e7a Standardize uuid generation for events/storage/registry (#39184) 2020-08-24 17:21:30 +02:00
Bas NijholtandGitHub 0427d87ba4 Bump codespell from v1.16.0 to v1.17.1 and fix new spelling errors (#38663) 2020-08-08 14:41:02 +02:00
c291d4aa7d Intelligent timeout handler for setup/bootstrap (#38329)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-08-05 14:58:19 +02:00
J. Nick KostonandGitHub a91f5b7192 Prevent ping integration from blocking startup (#38504) 2020-08-05 12:43:35 +02:00
Jelle RaaijmakersandGitHub ef254a1c3d Round time values in get_age() to better approximate the actual age (#37125) 2020-07-09 11:19:38 -07:00
Paulus SchoutsenandGitHub 3ee3ae7633 Fix cloudhooks coming in for non existing webhooks (#36836)
* Fix cloudhooks coming in for non existing webhooks

* Fix tests"
2020-06-15 16:30:40 -07:00
Paulus SchoutsenandGitHub fae80621fb Guard blowing up converting 0 mired/kelvin (#35486) 2020-06-04 08:48:39 -07:00
J. Nick KostonandGitHub 1297a09344 Avoid locking in the logging queue handler (#35700)
* Avoid locking in the logging queue handler

We do not need a lock here as the underlying queue is already
thread safe.

* Add coverage for logging handle
2020-05-17 14:39:27 +02:00
J. Nick KostonandGitHub 73616520c0 Use built in queue log handlers to avoid formatting logs in the event loop (#35633)
* Use built in queue log handlers to avoid formatting logs in the event loop

Logging is now formatted and written in another thread to
ensure there is minimal impact on the event loop when
a log message is processed.

This change replaces the existing AsyncHandler log handler
as python 3.7+ now offers an off the shelf solution

* add a simple test

* s/async_migrate_log_handlers_to_queue/async_activate_log_queue_handler/g
2020-05-16 09:29:58 -05:00
Franck NijhofandGitHub 2223592486 Add get_url helper, deprecate base_url (#35224) 2020-05-08 02:29:47 +02:00
Erik MontnemeryandGitHub f1ecac92df Fail tests if wrapped callbacks or coroutines throw (#35010) 2020-05-06 14:14:57 -07:00
Paulus SchoutsenandGitHub 2af984917e Use asynctest-mock in most places (#35109)
* Use asynctest-mock in most places

* Fix broken patch in pilight
2020-05-03 11:27:19 -07:00
Paulus SchoutsenandGitHub ec47216388 Use built-in test helpers on 3.8 (#34901) 2020-04-30 13:29:50 -07:00
Paulus SchoutsenandGitHub e7f8d6bbf7 Fix more tests on Python 3.8 (#34703) 2020-04-25 15:52:50 -07:00
Paulus SchoutsenandGitHub d011b46985 Patch http.client to not do I/O in the event loop (#34194) 2020-04-15 15:32:10 -07:00
Paulus SchoutsenandGitHub d93c09327a Report unserializable data in websocket (#34072)
* Report unserializable data in websocket

* Fix tests

* log types too
2020-04-13 23:46:41 -07:00
springstanandGitHub eae21be5b9 Improve string formatting v6 (#33698) 2020-04-07 23:14:28 +02:00
Franck NijhofandGitHub 60bc517d01 Collection of core tests improvements (#33757)
* Collection of core tests improvements

* Added some more

* Fix aiohttp client response release
2020-04-07 09:33:23 -07:00
J. Nick KostonandGitHub 4a32a0f1da Expand network util to check for link local addresses (#33499) 2020-04-01 11:24:30 -07:00
Paulus SchoutsenandGitHub a6b5d73f1c Report which data causes JSON serialization error (#31901) 2020-02-17 10:49:42 -08:00
Ville SkyttäandGitHub 5e2ba2eb77 Enable some more bandit checks (#30857)
* Enable B108 (hardcoded tmp dir), address findings

* Enable B602 (subprocess popen with shell), address findings

* Enable B604 (start process with shell), address findings

* Enable B306 (mktemp), B307 (eval), and B325 (tempnam), no issues to address
2020-01-20 18:44:55 +02:00
Paulus SchoutsenandPascal Vizeli e1205409f3 Handle location API being exhausted (#30798) 2020-01-16 17:31:12 +01:00
Ville SkyttäandGitHub 5216477353 Be consistent with Home Assistant and Hass.io spelling (#30500)
* Be consistent with Home Assistant spelling

* Be consistent with Hass.io spelling
2020-01-05 14:09:17 +02:00
Ville SkyttäandGitHub e6388e186c Remove unnecessary string literal concatenations (#30360) 2020-01-02 21:17:10 +02:00
Ville SkyttäandPaulus Schoutsen 445fd15f76 Drop Python 3.6 support (#29978) 2019-12-16 07:29:19 +01:00
Bas NijholtandFranck Nijhof f60125b5c9 Sort imports according to PEP8 for 'tests' (#29791) 2019-12-09 16:52:24 +01:00
Ville SkyttäandFabian Affolter d88ca0f5cb Lint exclusions (#28655)
* Remove malformed pylint disable markers

* Remove some unused imports

* Remove some unneeded lint exclusions

* Remove more unneeded lint exclusions

* Add specific codes to all noqa's
2019-11-16 10:22:07 +01:00
Tim Gatesandcgtobi c3f07347a1 Fix simple typo: unhasable -> unhashable (#28605) 2019-11-07 12:39:16 +01:00
Franck NijhofandPascal Vizeli 2e17ad86af Adds guards for missing information in call stack frames (#27217) 2019-10-05 11:59:33 +02:00
Pascal VizeliandGitHub c1851a2d94 Cleanup coroutine threadsafe (#27080)
* Cleanup coroutine threadsafe

* fix lint

* Fix typing

* Fix tests

* Fix black
2019-10-01 16:59:06 +02:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
Paulus SchoutsenandGitHub 7d33b0a259 Fix broken test in Python 3.7 (#25067) 2019-07-10 12:17:10 -07:00
Anders MelchiorsenandOtto Winter a439e087e1 Fix time expression parsing (#24696) 2019-06-22 13:39:33 +02:00
Pascal VizeliandPaulus Schoutsen c9453bab19 Prefere binary with wheels (#24669) 2019-06-21 08:47:56 -07:00
Pascal VizeliandPaulus Schoutsen d9852bc75d Support Hass.io wheels / docker env (#24175)
* Support Hass.io wheels / docker env

* address comments

* fix lint
2019-05-29 15:30:09 -07:00
Paulus SchoutsenandGitHub 179fb0f3b5 Use importlib metadata to check installed packages (#24114)
* Use importlib metadata

* Fix script

* Remove unused import

* Update requirements"
2019-05-26 11:58:42 -07:00
Paulus SchoutsenandGitHub 9e96397e6a Require core config detection to be triggerd manually (#24019)
* Detect core config

* Remove elevation

* Lint

* Lint

* Fix type
2019-05-22 17:24:46 -07:00
Ties de KockandPaulus Schoutsen 4004867eda Split up yaml loaders into multiple files (#23774)
* Start moving parts of yaml utils to own module

Move parts of yaml loader out of the single large file and start
to create the structure of the yaml loaders in Ansible [0].

[0]: https://github.com/ansible/ansible/tree/devel/lib/ansible/parsing/yaml

* Finish yaml migration, update tests and mocks

  * Move code around to finish the migration
  * Update the mocks so that `open` is patched in
    `homeassistant.util.yaml.loader` instead of
    `homeassistant.util.yaml`.
  * Updated mypy ignores
  * Updated external API of `homeasistant.util.yaml`, see below:

Checked what part of the api of `homeassistant.util.yaml` was actually
called from outside the tests and added an `__ALL__` that contains only
these elements.

Updated the tests so that references to internal parts of the API (e.g.
the yaml module imported into `homeassistant.util.yaml.loader`) are
referenced directly from `homeassistant.util.yaml.loader`.

In `tests/test_yaml.py` the import `yaml` refers to
`homeassistant.util.yaml` and `yaml_loader` refers to `~.loader`.

Future work that remains for the next iteration is to create a custom
SafeConstructor and refers to that instead of monkey patching `yaml` with
custom loaders.

* Update mocks in yaml dumper, check_config
2019-05-09 09:07:56 -07:00