Commit Graph

357 Commits

Author SHA1 Message Date
J. Nick Koston
f91de1c8b9 Add support for capturing renewals to dhcp discovery (#48242) 2021-03-30 15:41:12 +02:00
Franck Nijhof
ad13a9295e Merge multiple context managers in tests (#48146) 2021-03-27 09:17:15 +01:00
J. Nick Koston
b50dcef94f Block detectable I/O in the event loop (#48387)
We added a warning when this happens last April and gave developers
a year to fix the instability. We now prevent the instability by
raising RuntimeError when code attempts to do known I/O in the
event loop instead of the executor.

We now provide a suggestion on how to fix the code that is causing
the issue.
2021-03-27 08:54:49 +01:00
J. Nick Koston
c340a39275 Handle range conversions that do not start at 1 (#48298) 2021-03-24 12:33:44 -10:00
Franck Nijhof
6932cf9534 Use contextlib.suppress where possible (#48189) 2021-03-23 14:36:43 +01:00
Franck Nijhof
5a2b5fe7c5 Yoda assertion style removed is (#48142) 2021-03-20 13:55:10 +01:00
Franck Nijhof
e47d8da3b4 Remove defunct test from percentage util (#48125) 2021-03-19 17:16:45 -05:00
Franck Nijhof
8a56dbf587 Add flake8 comprehensions checks to pre-commit & CI (#48111) 2021-03-19 13:41:09 +01:00
Paulus Schoutsen
7fe3c472e9 Improve bad JSON data reporting (#47932)
* Improve bad data reporting

* Fix tests

Co-authored-by: Erik <erik@montnemery.com>
2021-03-15 10:41:25 +01:00
J. Nick Koston
9a686d148e Ensure startup can proceed when there is package metadata cruft (#47706)
If a package fails to install or partially installed importlib
version can return None. We now try pkg_resources first, then
try importlib, and handle the case where version unexpectedly
returns None
2021-03-10 21:12:02 -10:00
Paulus Schoutsen
2df644c6cc Clean up secret loading (#47034) 2021-03-02 12:58:53 -08:00
Paulus Schoutsen
633a7aeb22 Remove deprecated credstash + keyring (#47033) 2021-02-25 09:48:19 +01:00
Tom Parker-Shemilt
27d16af36b Don't allow recursive secrets loading (#41812)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-02-14 14:23:31 +01:00
J. Nick Koston
9f59515bb8 Fix shutdown deadlock with run_callback_threadsafe (#45807) 2021-02-01 10:54:39 +01:00
J. Nick Koston
068d1b5eb8 Separate fan speeds into percentages and presets modes (#45407)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: John Carr <john.carr@unrouted.co.uk>
2021-01-27 17:44:36 -06:00
Thomas Hollstegge
78b057ce02 Make sure generated slugs are not empty (#43153) 2021-01-27 12:25:49 +01:00
Joakim Sørensen
b1c2cde40b Changes to filename and path validation (#45529)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-01-26 15:53:21 +01:00
Paulus Schoutsen
0930aae208 Avoid misuse sanitize_path, clarify docs (#45469) 2021-01-23 18:28:57 +01:00
Pascal Vizeli
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 Nijhof
65cf2fcb6f Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
Paulus Schoutsen
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 Koston
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
springstan
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
Paulus Schoutsen
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
Dmitry
b106149588 Fix string parameter processing in parse_time_expression (#41468) (#41469) 2020-10-09 11:48:49 +02:00
J. Nick Koston
8d5c124deb Improve performance of generating non-cryptographically secure uuids (#41314) 2020-10-07 16:37:01 +02:00
J. Nick Koston
e08ee282ab Abort execution of template renders that overwhelm the system (#40647) 2020-09-28 14:43:22 +02:00
J. Nick Koston
f8704a2dfc Ensure we always fire time pattern changes after microsecond 0 (#39302) 2020-08-28 16:27:25 +02:00
Franck Nijhof
1c2ebdf307 Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
Paulus Schoutsen
51a63c1fc4 Drop last bits of asyncio.coroutine (#39280) 2020-08-26 16:57:52 +02:00
J. Nick Koston
bee6d87e7a Standardize uuid generation for events/storage/registry (#39184) 2020-08-24 17:21:30 +02:00
Bas Nijholt
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
Pascal Vizeli
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 Koston
a91f5b7192 Prevent ping integration from blocking startup (#38504) 2020-08-05 12:43:35 +02:00
Jelle Raaijmakers
ef254a1c3d Round time values in get_age() to better approximate the actual age (#37125) 2020-07-09 11:19:38 -07:00
Paulus Schoutsen
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 Schoutsen
fae80621fb Guard blowing up converting 0 mired/kelvin (#35486) 2020-06-04 08:48:39 -07:00
J. Nick Koston
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 Koston
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 Nijhof
2223592486 Add get_url helper, deprecate base_url (#35224) 2020-05-08 02:29:47 +02:00
Erik Montnemery
f1ecac92df Fail tests if wrapped callbacks or coroutines throw (#35010) 2020-05-06 14:14:57 -07:00
Paulus Schoutsen
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 Schoutsen
ec47216388 Use built-in test helpers on 3.8 (#34901) 2020-04-30 13:29:50 -07:00
Paulus Schoutsen
e7f8d6bbf7 Fix more tests on Python 3.8 (#34703) 2020-04-25 15:52:50 -07:00
Paulus Schoutsen
d011b46985 Patch http.client to not do I/O in the event loop (#34194) 2020-04-15 15:32:10 -07:00
Paulus Schoutsen
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
springstan
eae21be5b9 Improve string formatting v6 (#33698) 2020-04-07 23:14:28 +02:00
Franck Nijhof
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 Koston
4a32a0f1da Expand network util to check for link local addresses (#33499) 2020-04-01 11:24:30 -07:00
Paulus Schoutsen
a6b5d73f1c Report which data causes JSON serialization error (#31901) 2020-02-17 10:49:42 -08:00