Commit Graph

31 Commits (a88edc71303518bf7b21d49a20bcc0a7be28e68f)

Author SHA1 Message Date
Erik Montnemery da11a72b4c
Create repair asking user to remove duplicate config entries (#127948)
Co-authored-by: Joostlek <joostlek@outlook.com>
2024-10-29 13:10:56 +01:00
Erik Montnemery d82bff1bc2
Index config entry discovery_keys by discovery domain (#126563)
* Index config entry discovery_keys by discovery domain

* Add new signal

* Update tests

* Update homeassistant/config_entries.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Fix imports

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-09-23 21:48:11 +02:00
Erik Montnemery b2982c18bb
Reinitialize zeroconf discovery flow on unignore (#125753)
* Reinitialize zeroconf discovery flow on unignore

* Adjust tests

* Improve comments

* Fix logic for updating discovery keys

* Add tests

* Use mock_config_flow helper in new config_entries test

* Add discovery_keys attribute to ConfigEntry

* Update zeroconf rediscovery

* Change type of ConfigEntry.discovery_keys

* Update tests

* Fix DiscoveryKey.from_json_dict and add tests

* Fix test

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-09-23 16:49:21 +02:00
Robert Resch ad50136dbd
Add created_at/modified_at to config entries (#122456) 2024-07-29 22:08:46 +02:00
Jan Bouwhuis 19fa39d556
Generate ConfigValidationError message from English translations (#113844)
* Fetch ConfigValidationError message from translation cache

* Sync error logmessages with translation cache

* More sync

* Cleanup

* Remove unrelated change

* Follow up comments

* Rebase and improve contructor

* Improve name

* Rename to MULTIPLE_INTEGRATION_CONFIG_ERRORS
2024-03-25 10:39:30 +01: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
Erik Montnemery 6908497c3d
Add minor version to config entries (#105479) 2023-12-12 08:44:35 +01:00
Erik Montnemery 94fd7d0353
Improve test of config entry store (#105487)
* Improve test of config entry store

* Tweak test
2023-12-11 10:48:12 -05: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 25bea91683
Use modern platform path when reporting platform config errors (#104238)
* Use modern platform path when reporting platform config errors

* Update tests

* Address review comment

* Explicitly pass platform domain to log helpers

* Revert overly complicated changes

* Try a simpler solution
2023-12-05 15:06:13 +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 80813e992d
Improve formatting of component errors (#104081)
* Improve formatting of component errors

* Update tests
2023-11-17 23:01:00 +01:00
Erik Montnemery 23ef97f774
Use relative paths in yaml syntax error messages (#104084) 2023-11-17 23:00:23 +01:00
Erik Montnemery a78764f000
Improve formatting of package errors (#104078) 2023-11-17 14:57:37 +01:00
Erik Montnemery b400b33b0d
Refer to domain configuration in custom validator errors (#104065) 2023-11-16 15:28:48 +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 dd7670cacf
Improve errors for component configuration with missing keys (#103982) 2023-11-15 10:47:05 +01:00
Erik Montnemery e87ebbef01
Improve errors for component configuration with multiple errors (#103969)
* Improve errors for component configuration with multiple errors

* Suffix with link to documentation
2023-11-14 21:50:54 +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 94a2087ba0
Improve formatting of config validation errors (#103957)
* Improve formatting of config validation errors

* Address review comments
2023-11-14 12:48:45 +01:00
Erik Montnemery 85eac5a1b1
Add additional test for package errors (#103955)
* Add additional test for package errors

* Adjust tests
2023-11-14 11:48:56 +01:00
Erik Montnemery 44c1cef42e
Add tests for component configuration with extra keys (#103959) 2023-11-14 11:26:22 +01:00
Erik Montnemery dedd3418a1
Improve print of line numbers when there are configuration errors (#103216)
* Improve print of line numbers when there are configuration errors

* Update alarm_control_panel test
2023-11-14 08:21:36 +01:00
Erik Montnemery 07af073735
Remove trailing space from configuration error messages (#103909)
* Remove trailing space from configuration error messages

* Update test
2023-11-13 15:19:37 +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