Commit Graph

160 Commits (b07e9df308a2fec26d76ee0ae046c5699d0546d1)

Author SHA1 Message Date
J. Nick Koston 6a243d6705
Preload platform integrations to better group executor usage (#112010) 2024-03-02 23:03:35 -10:00
J. Nick Koston 3808e8b0bc
Switch config to use async_get_component/async_get_platform (#112071) 2024-03-02 13:56:25 -10:00
chammp a5cc0ae890
Improve package schema validation (#108125)
* Add failing tests for package config validation error wrapping

* Wrap package schema validation errors in HomeAssistantError

* Fix yamllint errors

* Rework package merge validation

Ignore invalid package definitions instead of failing startup.
Output error messages with locations if possible when a package
definition has errors.

* Ruff format

* Fix linter errors

* Move package_definition_schema to module scope

* Move inner function to module level

* Merge exception handlers

Merge exception handlers for config schema validation and package merge
to avoid untested code branches

* Fix long lines and doc strings

* More minor changes to exception handler

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-02-10 20:16:20 +01:00
Robert Resch 8b08b5e8d2
Deprecate legacy_templates (#105556)
* Deprecate legacy_templates

* Improve wording

* Implement suggestion

* simplify

* Add deleting of the repair issues back

* Update homeassistant/components/homeassistant/strings.json

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

* Test issue removal too

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-12-22 00:42:16 +01:00
Erik Montnemery 3bcc6194ef
Add domain key config validation (#104242)
* Drop use of regex in helpers.extract_domain_configs

* Update test

* Revert test update

* Add domain_from_config_key helper

* Add validator

* Address review comment

* Update snapshots

* Inline domain_from_config_key in validator
2023-12-05 15:07:32 +01:00
Erik Montnemery 95f7db1970
Move config_per_platform and extract_domain_configs to config.py (#104989) 2023-12-04 12:48:49 +01:00
Jan Bouwhuis af71c2bb45
Raise and suppress stack trace when reloading yaml fails (#102410)
* Allow async_integration_yaml_config to raise

* Docstr - split check

* Implement as wrapper, return dataclass

* Fix setup error handling

* Fix reload test mock

* Move log_messages to error handler

* Remove unreachable code

* Remove config test helper

* Refactor and ensure notifications during setup

* Remove redundat error, adjust tests notifications

* Fix patch

* Apply suggestions from code review

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Follow up comments

* Add call_back decorator

* Split long lines

* Update exception abbreviations

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-11-24 17:34:45 +01:00
Erik Montnemery 124e1cebac
Small improvement of config tests (#104243)
* Small improvement of config tests

* Update snapshots
2023-11-20 14:15:29 +01:00
Erik Montnemery d8a49b14e5
Use relative paths in configuration validation error messages (#104064) 2023-11-16 10:56:47 +01:00
Erik Montnemery 98030a9ce1
Improve formatting of package errors (#103976) 2023-11-16 09:08:47 +01:00
Erik Montnemery 5b37096b5f
Refactor config.async_log_exception (#104034)
* Refactor config.async_log_exception

* Improve test coverage

* Make functions public
2023-11-15 19:09:49 +01:00
Erik Montnemery c4bf8f96dd
Add tests for components with custom validators (#104024)
* Add tests for components with custom validators

* Address review comments
2023-11-15 13:11:33 +01:00
Erik Montnemery 2cb4435cf0
Add tests for component configuration with documentation links (#103971) 2023-11-14 17:14:34 +01:00
Erik Montnemery 381ebf3e53
Add tests for component configuration with multiple errors (#103964)
* Add tests for component configuration with multiple errors

* Add new configuration file

* Fix typo

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-11-14 15:08:20 +01:00
Erik Montnemery 44c1cef42e
Add tests for component configuration with extra keys (#103959) 2023-11-14 11:26:22 +01:00
Erik Montnemery e64582ae9a
Add tests for yaml syntax errors (#103908) 2023-11-13 14:04:58 +01:00
Erik Montnemery be2cee228c
Add tests for package errors (#103902) 2023-11-13 11:21:37 +01:00
Erik Montnemery d0efea3dbd
Add tests for configuration validation errors (#103848)
* Add tests for configuration validation errors

* Use absolute path for hass.config.config_dir

* Apply suggestions from code review

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-11-13 07:25:58 +01:00
Erik Montnemery 97cc05d0b4
Make it possible to restart core in safe mode (#102606) 2023-10-24 14:47:58 +02:00
Ville Skyttä 6399d74c15
Remove unnnecessary pylint configs from core (#98704) 2023-08-22 23:12:12 +02:00
epenet a51cc75f03
Add type hints to core tests (part 2) (#88492) 2023-02-21 09:27:13 +01:00
Jan Bouwhuis 4f6a25b470
Allow parameterizing YAML config in tests (#87981)
* Add fixture to parameterize yaml config

* Apply to more tests

* Re-add @fixture label

* Add fixtures to patch yaml content and targets

* Typo

* Improve docstr

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Update references to mock_yaml_configuration

* Apply new fixtures

* Apply to check_config tests

* Follow up comments

* Rename fixtures, update docstr

* Split paths

* Patch load_yaml_config_file instead

* sort

* Fix tests

* improve docst

* Rename fixtures

* sorting

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Improve docstr

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Improve docstr

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Improve docstr

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Improve docstr

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Improve docstr

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Improve docstr

Co-authored-by: Erik Montnemery <erik@montnemery.com>

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-02-20 16:57:12 +01:00
Franck Nijhof ed79265843
Enable Ruff PT006 (#88165)
* Enable Ruff PT006

* Adjust existing cases

* Fix tests

* Remove unneeded parentheses
2023-02-15 14:09:50 +01:00
epenet c98b4e3204
Add typing to tests with single hass argument (2) (#87675)
* Add typing to tests with single hass argument (2)

* a few more
2023-02-08 08:51:43 +01:00
epenet 59ca7780fa
Add typing to tests with single hass argument (#87631) 2023-02-07 15:01:16 +01:00
epenet 4142f0d15d
Add return type to tests without arguments (#87613)
* Add return type to tests without arguments

* Black

* Cancel fixture amends
2023-02-07 14:20:06 +01:00
Franck Nijhof bfbf9b9751
Adjusts imports in tests to match our relative import rules (#86788) 2023-01-27 12:51:58 +01:00
epenet 561fc2d771
Remove deprecated unit system properties (#86643)
* Remove deprecated unit system properties

* Fix tests
2023-01-27 12:09:26 +01:00
epenet 30bf0634fe
Add per-file-ignore to pylint (#86289) 2023-01-22 17:26:24 +01:00
Franck Nijhof 24fdd588fd
Code styling tweaks to the tests - Part 1 (#86192) 2023-01-20 13:52:46 +01:00
Erik Montnemery 67e4f2c202
Raise repairs issue if country is not configured (#82685) 2022-11-28 09:54:13 +01:00
Erik Montnemery e1338adf1a
Allow configuring country and language in core config (#81734)
* Allow configuring country and language in core config

* Add script for updating list of countries

* Use black for formatting

* Fix quoting

* Move country codes to a separate file

* Address review comments

* Add generated/countries.py

* Get default language from owner account

* Remove unused variable

* Add script to generate list of supported languages

* Add tests

* Fix stale docsring

* Use format_python_namespace

* Correct async_user_store

* Improve typing

* Fix with_store decorator

* Initialize language in core store migration

* Fix startup

* Tweak

* Apply suggestions from code review

Co-authored-by: Franck Nijhof <git@frenck.dev>

* Update storage.py

Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-11-24 23:25:50 +01:00
Erik Montnemery a2da1c7db5
Create repairs issue if an outdated currency code is configured in core store (#81772)
* Create repairs issue if an outdated currency code is configured in core store

* Update homeassistant/config.py

Co-authored-by: Aarni Koskela <akx@iki.fi>

Co-authored-by: Aarni Koskela <akx@iki.fi>
2022-11-10 17:28:19 +01:00
Erik Montnemery c3d4a9cd99
Create repairs issue if an outdated currency code is configured (#81717)
* Create repairs issue if an outdated currency code is configured

* Add script for updating list of currencies

* Use black for formatting

* Move currency codes to a separate file

* Address review comments
2022-11-08 07:21:09 +01:00
epenet 67d1dde69f
Rename IMPERIAL_SYSTEM to US_CUSTOMARY_SYSTEM (#80253)
* Rename IMPERIAL_SYSTEM

* Deprecate is_metric property and adjust tests

* Adjust unit_system config validation

* Add yaml tests

* Add tests for private name

* Fix incorrect rebase

* Adjust docstring

* Add store migration

* Update unit_system.py

* Minimise test tweaks

* Fix tests

* Add conversion to migration

* Rename new key and adjust tests

* Adjust websocket_detect_config

* Move original_unit_system tracking to subclass
2022-10-19 13:31:08 +02:00
epenet 8dc3ff72c6
Cleanup config deprecation warning (#80251) 2022-10-14 13:03:17 +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
Erik Montnemery cf4033b1bc
Simplify time zone setting in tests (#68330)
* Simplify timezone setting in tests

* Fix typo

* Adjust caldav tests

* Adjust input_datetime tests

* Adjust time_date tests

* Adjust tod tests

* Adjust helper tests

* Adjust recorder tests

* Adjust risco tests

* Adjust aemet tests

* Adjust flux tests

* Adjust forecast_solar tests

* Revert unnecessary change in forecast_solar test

* Adjust climacell tests

* Adjust google tests

* Adjust sensor tests

* Adjust sonarr tests

* Adjust template tests

* Adjust zodiac tests

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-03-20 10:25:15 +01:00
Tobias Sauerwein 8b38fa58aa
Bump pytest to 7.0.0 (#65981) 2022-02-08 10:03:27 +01:00
Franck Nijhof fa09cf663e
Update black to 22.1.0 (#65788) 2022-02-05 14:19:37 +01:00
Erik Montnemery d4310f0d70
Remove groups.yaml from default config (#63366)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2022-01-04 23:16:08 -08:00
Ville Skyttä 1ec8619687
Make core config source an enum (#61966)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-12-19 18:02:52 +01:00
Erik Montnemery d18c250acf
Add minor version support to storage.Store (#59882) 2021-11-18 17:15:40 +01:00
Paulus Schoutsen 952d11cb03
Ensure internal/external URL have no path (#54304)
* Ensure internal/external URL have no path

* Fix comment typo

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-08-09 09:38:09 +02:00
Paulus Schoutsen 8377b557da
Packages to support config platforms (#54085) 2021-08-05 13:11:01 -07:00
Franck Nijhof 1968b95829
Add currency core configuration (#53541)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-07-28 08:55:58 +02:00
Franck Nijhof c5383219f1
Remove stale debug statements from tests (#51059) 2021-05-25 11:52:20 +02:00
J. Nick Koston bf2d40adfe
Migrate from pytz to python-dateutil (#49643)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-05-07 22:46:26 -07:00
Joakim Sørensen 3088f063d2
Don't overwrite existing files when generating configuration (#49815) 2021-04-28 17:15:04 +02:00
Franck Nijhof 89e7983ee0
Add Blueprint foundation to Scripts (#48621)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-04-27 15:15:38 -07:00