Commit Graph
370 Commits
Author SHA1 Message Date
J. Nick Koston bf819df388 Fix shutdown deadlock with run_callback_threadsafe (#45807) 2021-02-01 22:31:03 +00:00
Thomas Hollstegge 78b057ce02 Make sure generated slugs are not empty (#43153) 2021-01-27 12:25:49 +01:00
Joakim SørensenandPaulus Schoutsen 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
Ville Skyttä 94dbcc9d2b Generics and other type hint improvements (#45250) 2021-01-18 22:23:25 +01:00
Pascal VizeliandFranck Nijhof 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
43474762b2 Drop remaining Python < 3.8 support (#44743)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-01-04 11:47:29 +01:00
Franck Nijhof 2f486543df Drop Python 3.7 support (#43805) 2021-01-01 13:47:01 +01:00
Paulus Schoutsen 58648019c6 Deprecate the use of keyring and credstash (#43854) 2020-12-02 16:55:33 +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
Paulus SchoutsenandMartin Hjelmare edf70e9f06 Make input_datetime better handle timezones (#43396)
* Make input_datetime better handle timezones

* Improve test coverage

* Apply suggestions from code review

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Revert change to time format

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-11-26 20:20:10 +01:00
springstan 37bcfd1d2f Simplify distance conversion (#43107) 2020-11-11 20:10:17 +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
springstanandPaulus Schoutsen 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
Philip Allgaier dde6305549 Cleanup unused loggers (components N-Z + tests) (#41982) 2020-10-16 21:24:08 -05:00
Ville Skyttä f28c3273c2 Upgrade mypy to 0.790 (#41595) 2020-10-12 19:17:30 -05:00
J. Nick Koston a9de9c62f1 Use native utc timezone for utcnow() (#41727)
This allows timezone operations to happen in C code instead
of the pure-python code of pytz
2020-10-12 17:43:21 -05: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
springstan a2c3c33b22 Use core GitHub URL in all files (#41089) 2020-10-03 00:04:11 +02:00
J. Nick Koston e08ee282ab Abort execution of template renders that overwhelm the system (#40647) 2020-09-28 14:43:22 +02:00
Bjørn Snoen f207d46390 Allow using environment cacert file (#38816) 2020-09-04 13:54:20 +02:00
Ville Skyttä 1bf2c4d976 Upgrade pylint to 2.6.0 (#39363) 2020-08-29 07:59:24 +02:00
Ville Skyttä b4bac0f7a0 Exception chaining and wrapping improvements (#39320)
* Remove unnecessary exception re-wraps

* Preserve exception chains on re-raise

We slap "from cause" to almost all possible cases here. In some cases it
could conceivably be better to do "from None" if we really want to hide
the cause. However those should be in the minority, and "from cause"
should be an improvement over the corresponding raise without a "from"
in all cases anyway.

The only case where we raise from None here is in plex, where the
exception for an original invalid SSL cert is not the root cause for
failure to validate a newly fetched one.

Follow local convention on exception variable names if there is a
consistent one, otherwise `err` to match with majority of codebase.

* Fix mistaken re-wrap in homematicip_cloud/hap.py

Missed the difference between HmipConnectionError and
HmipcConnectionError.

* Do not hide original error on plex new cert validation error

Original is not the cause for the new one, but showing old in the
traceback is useful nevertheless.
2020-08-28 13:50:32 +02:00
Franck Nijhof 1c2ebdf307 Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
J. Nick Koston bee6d87e7a Standardize uuid generation for events/storage/registry (#39184) 2020-08-24 17:21:30 +02:00
Bram Kragten 28332f23b3 Don't sort keys when dumping json and yaml (#39214) 2020-08-24 16:58:27 +02:00
J. Nick Koston 42227c1c53 Improve the performance of dt_util.utcnow() (#39145) 2020-08-23 09:57:58 +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 Koston a91f5b7192 Prevent ping integration from blocking startup (#38504) 2020-08-05 12:43:35 +02:00
Ville Skyttä ac0dbb17af Attrs cleanups (#37849) 2020-07-14 10:30:30 -07: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
Franck Nijhof 53545c984b Log lines do not end with a full stop (#37527) 2020-07-05 23:04:19 +02:00
Jeffery To a74e35795c Use the built-in importlib.metadata library in Python 3.8+ (#36225)
importlib_metadata is a backport of this library for Python 3.7 and
older.
2020-06-17 15:21:14 +02: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
J. Nick Koston 36b157b85a Ensure verbose logging flag is respected. (#36444) 2020-06-04 09:51:06 -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
Ville Skyttä b4404b071f Pylint cleanups (#35409)
* Avoid some outer name redefinitions

* Remove unneeded directives

* Narrow directive scope

* Don't disable redefined-variable-type
2020-05-09 14:08:40 +03: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 0246761f94 Log threading exceptions properly (#34789) 2020-04-28 14:31:35 -07:00
Martin Hjelmare 3aa2de5fa5 Disable pylint invalid name for TypeVar T (#34355) 2020-04-17 12:51:31 -07:00
Ville Skyttä 267d98b5eb Type hint improvements (#33082) 2020-04-17 11:33:58 -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 8d61893c39 Use HTTP_OK constant (#33798)
* Use http ok constant

* Remove incorrect use

* Run isort

* Fix pylint by adding missing imports

* Fix pylint by fixing one import
2020-04-08 11:47:38 -05:00
springstan eae21be5b9 Improve string formatting v6 (#33698) 2020-04-07 23:14:28 +02:00
springstan fca90a8ddc Improve string formatting v5 (#33697)
* Improve string formatting v5

* Address review comments
2020-04-05 17:48:55 +02:00