Commit Graph

102 Commits

Author SHA1 Message Date
Marc Mueller
2f0dd6f704 Import Generator from collections.abc (2) (#120915) 2024-07-01 11:58:49 +02:00
epenet
8bad421a04 Improve type hints in config tests (#120346) 2024-06-24 18:36:57 +02:00
epenet
c70cfbb535 Fix arguments-renamed pylint warning in tests (#119473) 2024-06-12 12:25:29 +02:00
epenet
c7e065c413 Move enable_custom_integrations fixture to decorator (#118844) 2024-06-05 09:20:08 +02:00
epenet
461ac1e0bc Add ClientSessionGenerator type hints in tests (#118377) 2024-05-29 14:49:14 +02:00
Erik Montnemery
5c1f6aeb60 Use mock_config_flow helper in config tests (#117245) 2024-05-11 14:09:00 -04:00
Erik Montnemery
3bea124d84 Sort asserts in config config_entries tests (#117244) 2024-05-11 17:38:07 +02:00
J. Nick Koston
6cf1c5c1f2 Hold a lock to prevent concurrent setup of config entries (#116482) 2024-04-30 18:47:12 -05:00
epenet
24f83c5890 Use is in FlowResultType enum comparison in tests (#114917)
* Use is in FlowResultType enum comparison in tests

* Adjust auth

* Adjust systemmonitor

* Once more

* Add comment
2024-04-05 10:40:14 +02:00
G Johansson
fc4d960d17 Add translation support to Config Entry errors (#106305)
* Config Entry error translation

* split key and placeholders

* Fix config entries tests

* translation optional

* Mods
2024-03-28 10:52:21 +01:00
Sid
00ec7f11f0 Enable Ruff rule PT007 (#113764)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2024-03-19 09:01:07 +01:00
Marc Mueller
38adfbf1a3 Add empty line after module docstring [tests a-e] (#112708) 2024-03-08 08:50:25 -05:00
G Johansson
9989a63cdf Add reconfigure step to config flow (#108794)
* Initial commit reconfigure

* test config config_entries

* Fix reconfigure

* test_config_entries

* review comment

* No reconfigure if reauth ongoing

* Fix tests

* Fix tests

* handle source creating flows

* combine

* No black

* Also check reconfigure in reauth flow

* Fix support

* Add entry id

* reset data entry flow

* Mods

* context data

* reset formatting

* Fix config flow platforms

* Fix tests

* Fix step message

* Handling reconfigure step

* Fix more tests

* Config entries tests

* entry_id always means reconfigure

* Mods

* Remove no longer valid exception

* Fixes

* reset silabs test

* dev reg

* resets

* assist pipeline

* Adjust config_entries

* Fix

* Fixes

* docstrings

* Review comment

* docstring
2024-03-01 12:29:35 +01:00
Erik Montnemery
a0e558c457 Add generic classes BaseFlowHandler and BaseFlowManager (#111814)
* Add generic classes BaseFlowHandler and BaseFlowManager

* Migrate zwave_js

* Update tests

* Update tests

* Address review comments
2024-02-29 16:52:39 +01:00
J. Nick Koston
50770ce436 Refactor config integration to use normal functions for setup (#110750)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-02-16 18:12:33 -06:00
J. Nick Koston
37897ee384 Move late import of config flows in loader to load time (#110688)
* Move late import of config flows in loader to load time

There does not seem to be any reason to import the
generated flows late. Import them at load time
with the rest of the generated files

* tests
2024-02-16 07:55:12 +01:00
Robert Resch
6fdad44941 Improve invalid error messages in the config flows (#108075) 2024-01-30 12:24:19 +01:00
Erik Montnemery
6908497c3d Add minor version to config entries (#105479) 2023-12-12 08:44:35 +01:00
Erik Montnemery
4536fb3541 Remove mock_entity_platform test helper (#104073) 2023-11-16 16:55:08 +01:00
Erik Montnemery
4498c2e8c4 Validate steps in Flowhandler (#102152)
* Validate steps in Flowhandler

* Move validation to FlowManager._async_handle_step

* Fix _raise_if_not_has_step

* Fix config_entries tests

* Fix tests

* Rename

* Add test
2023-10-19 13:34:10 +02:00
Erik Montnemery
b885dfa5a8 Add preview to sensor group config and option flows (#83638) 2023-08-22 10:29:16 +02:00
Robert Resch
b0f68f1ef3 Use @require_admin decorator (#98061)
Co-authored-by: Robert Resch <robert@resch.dev>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2023-08-14 15:07:20 +02:00
Erik Montnemery
9a3077d64a Always setup demo platforms with device support from config entry (#94586)
* Always setup demo platforms with device support from config entry

* Adjust test fixutres

* Update tests depending on the demo integration
2023-06-14 16:50:35 +02:00
Marvin Wichmann
795ef075da Restore original websocket commands for config entries (#93707)
Restore original websocket commands and add "config_entries/get_single"
2023-05-28 21:40:35 -04:00
epenet
dc14b83249 Add ability to unload demo integration (#92515)
* Add unload to demo integration

* Adjust config tests to use kitchen_sink

* Use async_unload_platforms
2023-05-24 09:38:29 +02:00
Erik Montnemery
b754f03eb1 Add WS command for getting a config entry (#93387)
* Add WS command for getting a config entry

* Update tests
2023-05-23 10:44:02 +02:00
Erik Montnemery
3931e11fd9 Try to load integration before starting option flow (#90111)
* Try to load integration before starting option flow

* Adjust tests
2023-03-22 20:10:10 +01:00
J. Nick Koston
e38836b6e1 Update async_matching_config_entries to use async_get_integrations (#88527)
* Update async_matching_config_entries to use async_get_integrations

* Update homeassistant/components/config/config_entries.py

* Update homeassistant/components/config/config_entries.py
2023-02-21 21:17:18 -05: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
9f688a564f Add type hints to integration tests (part 4) (#87848) 2023-02-11 08:26:13 +01:00
epenet
807c69f621 Add type hints to integration tests (b-c) (#87698) 2023-02-08 18:08:43 +01:00
Franck Nijhof
24fdd588fd Code styling tweaks to the tests - Part 1 (#86192) 2023-01-20 13:52:46 +01:00
Aarni Koskela
e4c73259f7 Configure autoflake for pre-commit (#82414) 2022-11-22 08:10:36 +01:00
Franck Nijhof
c4bbc439a5 Integrations v2.1: Differentiating hubs, devices and services (#80524)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-10-19 12:41:43 +02:00
J. Nick Koston
016a59ac94 Add support for subscribing to config entry changes (#77803) 2022-09-04 22:57:43 -05:00
Franck Nijhof
7cd68381f1 Search/replace RESULT_TYPE_* by FlowResultType enum (#74642) 2022-07-07 19:57:36 +03:00
J. Nick Koston
adf0f62963 Add websocket api to fetch config entries (#73570)
* Add websocket api to fetch config entries

* add coverage for failure case
2022-06-21 20:09:22 +02:00
Franck Nijhof
bfb47eb212 Final clean up of helpers accessed via hass (#72032)
* Final clean up of helpers accessed via hass

* Fix circular dep

* Fix import
2022-05-17 23:42:37 +03:00
Paulus Schoutsen
3213091b8d Add integration type (#68349) 2022-03-20 20:38:13 -07:00
Franck Nijhof
5965b015dd Adjust data entry flow to have an option data_schema (#67637) 2022-03-04 16:42:02 +01:00
J. Nick Koston
9a5eec561a Only set require_restart on config entry reload if its not recoverable (#66994) 2022-02-21 10:27:23 -08:00
Erik Montnemery
c496748125 Add WS API for removing a config entry from a device (#66188)
* Add WS API for removing a config entry from a device

* Address review comments

* Address review comments

* Remove entity cleanup from ConfigEntries

* Update + add tests

* Improve comments in test

* Add negative test

* Refactor according to review comments

* Add back async_remove_config_entry_device

* Remove unnecessary error handling

* Simplify error handling
2022-02-21 10:11:18 +01:00
Erik Montnemery
0eb2caabcf Report unmet dependencies for failing config flows (#65061)
* Report unmet dependencies for failing config flows

* Apply suggestions from code review

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

* Update homeassistant/setup.py

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

* Modify error message

* Add test

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-02-02 15:06:27 +01:00
Ville Skyttä
7db3246de4 Make config entry disabled_by an enum (#60445)
* Make config entry disabled_by an enum

* Update homeassistant/config_entries.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-12-15 20:53:21 +01:00
Marcel van der Veldt
7c7df5bb51 Change check for existence of options flow (#61147)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-12-07 12:50:34 -08:00
J. Nick Koston
af51aeb6dc Show how user input is malformed in the UI on error (#60057) 2021-11-23 22:50:54 +01:00
Ville Skyttä
73d192b3f3 Use HTTPStatus instead of HTTP_ consts and magic values in comp.../[bc]* (#57989) 2021-10-22 19:43:40 +02:00
Paulus Schoutsen
ee2c950716 Merge system options into pref properties (#51347)
* Make system options future proof

* Update tests

* Add types
2021-06-01 22:34:31 +02:00
Paulus Schoutsen
4821484d2c Add system option to disable polling (#51299) 2021-05-31 15:36:40 -07:00
Ville Skyttä
19d25cd901 Change config entry state to an enum (#49654)
* Change config entry state to an enum

* Allow but deprecate EntryState str equality comparison

* Test fixes

* Rename to ConfigEntryState

* Remove str comparability backcompat

* Update new occurrences of strs cropped up during review
2021-05-20 19:19:20 +02:00