1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-20 19:09:45 +00:00
Commit Graph

228 Commits

Author SHA1 Message Date
Tom Monck JR
6a7de24a04 Fix args passed to check_config script (#155885) 2025-11-06 19:27:53 +02:00
Benjamin Michaelis
acead56bd5 Enhance check_config script with JSON output and fail on warnings (#152575) 2025-10-19 21:55:55 +02:00
Thomas55555
567cc9f842 Bump colorlog to 6.10.1 (#154643) 2025-10-16 23:57:24 +01:00
Marc Mueller
2c13c70e12 Update ruff to 0.12.0 (#147106) 2025-06-19 20:39:09 +02:00
Marc Mueller
3d2dca5f0c Adjust scripts for compatibility with Python 3.14 (#146774) 2025-06-13 21:54:25 -04:00
Thomas55555
6d78c961d9 Bump colorlog to 6.9.0 (#142616) 2025-04-13 16:10:52 +02:00
Jan-Philipp Benecke
7b9ea63f17 Split out yaml loading into own package (#140683)
* Split out yaml loading into library

* Code review

* Code review

* Fix check config script
2025-03-15 22:26:18 -04:00
epenet
b7a344fd65 Standardize homeassistant imports in core and base platforms (#136730)
Standardize homeassistant imports in core
2025-01-28 13:11:48 -05:00
epenet
a05ac6255c Standardize util imports (#136723) 2025-01-28 15:54:06 +01:00
epenet
3a493bb6c0 Improve type hints in benchmark script (#136259) 2025-01-22 22:29:00 +01:00
epenet
1a628588b4 Improve type hints in scripts/auth (#124049) 2024-08-18 15:43:15 +02:00
J. Nick Koston
b09dd95dbd Improve alignment of live logbook and historical logbook models (#123070)
* Improve alignment of live logbook and historical logbook models

- Make EventAsRow as NamedType which is better aligned with
  sqlalchemy Row
- Use getitem to fetch results for both Row and EventAsRow
  since its an order of magnitude faster fetching sqlalchemy
  Row object values.

* final

* fix

* unused

* fix more tests

* cleanup

* reduce

* tweak
2024-08-04 23:09:10 +02:00
epenet
b609f8e962 Fix implicit-return in macos script (#122945) 2024-08-02 15:30:29 +02:00
epenet
e734971d33 Enable collections-named-tuple (PYI024) rule in ruff (#123019) 2024-08-02 15:28:32 +02:00
Marc Mueller
4cf0a3f154 Use PEP 695 for function annotations (3) (#117660) 2024-05-18 11:43:32 +02:00
Sid
2cc916db6d Replace pylint broad-except with Ruff BLE001 (#116250) 2024-05-07 14:00:27 +02:00
Sid
b456d97e65 Replace pylint protected-access with Ruff SLF001 (#115735) 2024-05-06 20:33:26 +02:00
Erik Montnemery
d31124d5d4 Avoid creating unneeded Context and Event objects when firing events (#113798)
* Avoid creating unneeded Context and Event objects when firing events

* Add test

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-20 09:40:06 +01:00
Sid
6ee273a548 Clean up unneeded ruff noqa directives (#113616) 2024-03-16 09:48:37 -10:00
Marc Mueller
a6b842f818 Add empty line after module docstring (2) [other] (#112738) 2024-03-08 19:16:38 +01:00
Marc Mueller
19ab3d6daf Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
Franck Nijhof
6ce16286d5 Update colorlog to 6.8.2 (#109072) 2024-01-29 23:24:17 +01:00
J. Nick Koston
ec15b0def2 Always load auth storage at startup (#108543) 2024-01-20 16:16:43 -10:00
Erik Montnemery
5b55c7da5f Remove logic converting empty or falsy YAML to empty dict (#103912)
* Correct logic converting empty YAML to empty dict

* Modify according to github comments

* Add load_yaml_dict helper

* Update check_config script

* Update tests
2023-12-05 18:08:11 +01:00
Erik Montnemery
e2f6fbd59b Fix colors in check_config script (#104069) 2023-11-17 13:21:04 -05:00
Erik Montnemery
3ba8a82243 Differentiate between warnings and errors in check_config helper (#102902)
* Differentiate between warnings and errors in check_config helper

* Update tests

* Treat configuration errors in frontend and its dependencies as errors

* Improve test coverage

* Address review comments

* Improve test coverage

* Improve test coverage

* Address review comments

* Add comment
2023-11-05 03:08:04 +01:00
Erik Montnemery
09ad1a9a36 Remove unnecessary block use of pylint disable in components p-z (#100192) 2023-09-12 20:47:48 +02:00
Erik Montnemery
7fcc2dd44e Make the check_config script open issue_registry read only (#98545)
* Don't blow up if validators can't access the issue registry

* Make the check_config script open issue_registry read only

* Update tests/helpers/test_issue_registry.py

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

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-08-18 20:15:00 +02:00
Erik Montnemery
91faa53843 Don't allow hass.config.config_dir to be None (#98442) 2023-08-16 13:00:14 +02:00
Erik Montnemery
3b9d6f2dde Add setup function to the component loader (#98148)
* Add setup function to the component loader

* Update test

* Setup the loader in safe mode and in check_config script
2023-08-15 10:59:42 +02:00
Franck Nijhof
38823bae71 Update colorlog to 6.7.0 (#96131) 2023-07-11 14:29:09 -04:00
epenet
ee781e4f49 Adjust registry access in scripts (#88884) 2023-02-28 21:58:47 -05:00
Franck Nijhof
79b52a2b41 Stricter pylint message control (#86154) 2023-01-20 13:47:55 +01:00
Franck Nijhof
64c2340fab Core code styling improvements (#85963) 2023-01-15 23:00:51 +01:00
Franck Nijhof
d4f69a3652 String formatting and max line length - Part 7 (#84532)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-12-27 11:18:56 +01:00
J. Nick Koston
8b067e83f7 Initial orjson support take 3 (#73849)
* Initial orjson support take 2

Still need to work out problem building wheels

--

Redux of #72754 / #32153 Now possible since the following is solved:
ijl/orjson#220 (comment)

This implements orjson where we use our default encoder.  This does not implement orjson where `ExtendedJSONEncoder` is used as these areas tend to be called far less frequently.  If its desired, this could be done in a followup, but it seemed like a case of diminishing returns (except maybe for large diagnostics files, or traces, but those are not expected to be downloaded frequently).

Areas where this makes a perceptible difference:
- Anything that subscribes to entities (Initial subscribe_entities payload)
- Initial download of registries on first connection / restore
- History queries
- Saving states to the database
- Large logbook queries
- Anything that subscribes to events (appdaemon)

Cavets:
orjson supports serializing dataclasses natively (and much faster) which
eliminates the need to implement `as_dict` in many places
when the data is already in a dataclass. This works
well as long as all the data in the dataclass can also
be serialized. I audited all places where we have an `as_dict`
for a dataclass and found only backups needs to be adjusted (support for `Path` needed to be added for backups).  I was a little bit worried about `SensorExtraStoredData` with `Decimal` but it all seems to work out from since it converts it before it gets to the json encoding cc @dgomes

If it turns out to be a problem we can disable this
with option |= [orjson.OPT_PASSTHROUGH_DATACLASS](https://github.com/ijl/orjson#opt_passthrough_dataclass) and it
will fallback to `as_dict`

Its quite impressive for history queries
<img width="1271" alt="Screen_Shot_2022-05-30_at_23_46_30" src="https://user-images.githubusercontent.com/663432/171145699-661ad9db-d91d-4b2d-9c1a-9d7866c03a73.png">

* use for views as well

* handle UnicodeEncodeError

* tweak

* DRY

* DRY

* not needed

* fix tests

* Update tests/components/http/test_view.py

* Update tests/components/http/test_view.py

* black

* templates
2022-06-22 21:59:51 +02:00
Martin Hjelmare
8049170e5a Initialize hass.config_entries for check config (#73575) 2022-06-16 14:40:41 +02:00
J. Nick Koston
dca4d3cd61 Significantly improve yaml load times when the C loader is available (#73337) 2022-06-13 08:44:46 -10:00
J. Nick Koston
c365454afb Revert "Initial orjson support (#72754)" (#72789)
This was causing the wheels to fail to build. We need
to workout why when we don't have release pressure

This reverts commit d9d22a9556.
2022-05-31 13:51:55 -07:00
J. Nick Koston
d9d22a9556 Initial orjson support (#72754) 2022-05-31 12:18:11 -07:00
Franck Nijhof
8f4caf4141 Clean up accessing event helpers via hass (#72011) 2022-05-17 19:36:29 +02:00
J. Nick Koston
24d7a464e1 Refactor logbook to reduce overhead and complexity (#71509) 2022-05-08 21:47:26 -07:00
J. Nick Koston
b8442d9340 Add json decode caching to logbook (#71080) 2022-05-01 19:33:31 -05:00
J. Nick Koston
fe6a4bfb1d Remove EVENT_TIME_CHANGED and EVENT_TIMER_OUT_OF_SYNC (#69643)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-04-09 09:05:54 -10:00
Marc Mueller
be7ef6115c Make TypeVars private (1) (#68205) 2022-03-17 18:52:38 +01:00
Franck Nijhof
fa09cf663e Update black to 22.1.0 (#65788) 2022-02-05 14:19:37 +01:00
Tobias Sauerwein
2c904c0974 Bump mypy to 0.930 (#62642)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2021-12-27 17:55:17 +01:00
Erik Montnemery
cb2c2d98c3 Remove unnecessary checks before calling os.makedirs (#62576) 2021-12-23 09:59:31 +01:00
Franck Nijhof
ca2f343c51 Upgrade colorlog to 6.6.0 (#59440) 2021-11-09 21:30:23 +02:00
Marc Mueller
77ee72cbb9 Import Callable from collections.abc (1) (#56775) 2021-09-29 16:32:11 +02:00