1
0
mirror of https://github.com/home-assistant/core.git synced 2025-11-03 16:09:36 +00:00
Commit Graph

23 Commits

Author SHA1 Message Date
J. Nick Koston
53a179088f Add debug mode to catch unsafe thread operations using core helpers ()
* adjust

* adjust

* fixes

* one more

* test

* debug

* move to config

* cover

* Update homeassistant/core.py

* set debug from RuntimeConfig

* reduce

* fix message

* raise

* Update homeassistant/core.py

* Update homeassistant/core.py

* no flood check for raise

* cover
2024-04-24 03:36:05 +02:00
Marc Mueller
816ce116bf Remove unnecessary functools.cached_property backport () 2024-04-04 11:24:26 +02:00
Marc Mueller
19ab3d6daf Add empty line after module docstring [helpers + other] () 2024-03-08 10:36:11 -05:00
J. Nick Koston
1fb9cfe37e Speed up the frame helper () 2024-03-06 20:54:09 -10:00
J. Nick Koston
6421a08ba8 Avoid expensive inspect calls in config validators ()
* Avoid expensive inspect calls in config validators

inspect has a performance problem https://github.com/python/cpython/issues/92041

We now avoid calling inspect unless we are going to log

* remove unused

* reduce

* get_integration_logger
2024-03-02 21:50:35 -05:00
Jan-Philipp Benecke
bc6b4d01c8 Deprecate hass.components and log warning if used inside custom component ()
* Deprecate @bind_hass and log error if used inside custom component

* Log also when accessing `hass.components`

* Log warning only when `hass.components` is used

* Change version

* Process code review
2024-02-29 12:25:46 +01:00
Erik Montnemery
dce5099d92 Use loader.async_suggest_report_issue in frame helper () 2023-10-05 19:52:26 +02:00
Erik Montnemery
7e39acda37 Minor improvement of frame helper ()
* Minor improvement of frame helper

* Add new custom integration for testing

* Make IntegrationFrame kw_only
2023-10-04 21:43:00 +02:00
Erik Montnemery
ab2de18f8f Refactor frame.get_integration_frame () 2023-10-03 19:21:27 +02:00
Franck Nijhof
d4f69a3652 String formatting and max line length - Part 7 ()
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-12-27 11:18:56 +01:00
Franck Nijhof
7adb0f0ef5 Custom component -> Custom integration () 2022-07-18 22:10:22 +02:00
Marc Mueller
97af164858 Prepare for upcoming mypy update () 2022-04-26 07:41:52 -07:00
Marc Mueller
eae0c75620 Make TypeVars private (2) () 2022-03-17 19:09:55 +01:00
epenet
b8b4855b8e Prevent log flooding in frame helper ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-06 15:26:31 -08:00
epenet
560546f65e Use dataclass for DhcpServiceInfo ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-23 13:35:53 +01:00
Ville Skyttä
f305d99af9 Add integration filtering and error if core options to helpers.frame.report ()
Reduces some existing and upcoming boilerplate.
2021-11-20 12:53:04 +02:00
Marc Mueller
77ee72cbb9 Import Callable from collections.abc (1) () 2021-09-29 16:32:11 +02:00
Marc Mueller
6fb2e63e49 Update typing 02 () 2021-03-17 18:34:19 +01:00
tkdrob
c2302784c2 Use core constants for helpers () 2021-02-08 22:53:17 +01:00
Ville Skyttä
b4bac0f7a0 Exception chaining and wrapping improvements ()
* 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
J. Nick Koston
444df4a7d2 Use the shared zeroconf instance when attempting to create another Zeroconf instance () 2020-08-12 16:08:33 +02:00
Paulus Schoutsen
f49ce5d1b4 Protect loop set default executor ()
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-07-06 15:58:53 -07:00
Martin Hjelmare
2a120d9045 Patch aiohttp client session close ()
* Patch aiohttp client session close

* Add test

* Restore close regardless of auto_cleanup

* Close session instead of detaching and do not restore

* Delint test

* Add frame helper

* Use frame helper

* Test warning log when closing session

* Clean up

* Correct docstring

* Do not change shutdown

* Fix tests
2020-05-13 09:58:33 +02:00