1
0
mirror of https://github.com/home-assistant/core.git synced 2025-08-12 06:50:00 +00:00
Commit Graph

160 Commits

Author SHA1 Message Date
Erik Montnemery
6908497c3d Add minor version to config entries () 2023-12-12 08:44:35 +01:00
Erik Montnemery
94fd7d0353 Improve test of config entry store ()
* Improve test of config entry store

* Tweak test
2023-12-11 10:48:12 -05:00
Erik Montnemery
4536fb3541 Remove mock_entity_platform test helper () 2023-11-16 16:55:08 +01:00
Franck Nijhof
70ad5ab3e4 Update helper tests to use device & entity registry fixtures () 2023-11-10 09:32:19 +01:00
J. Nick Koston
9b27552238 Fix race in starting reauth flows () 2023-10-31 12:38:05 -05:00
Erik Montnemery
4498c2e8c4 Validate steps in Flowhandler ()
* 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
J. Nick Koston
b8f8cd1797 Reduce overhead to retry config entry setup () 2023-09-02 16:46:53 -05:00
Marc Mueller
544d6b05a5 Replace mock_coro with AsyncMock ()
* Replace mock_coro with AsyncMock

* Remove mock_coro test helper function

* Remove redundant AsyncMock
2023-08-25 22:54:55 +02:00
J. Nick Koston
99e97782b6 Improve performance of abort_entries_match ()
* Improve performance of abort_entries_match

In  a ChainMap was added which called __iter__
and __contains__ which ends up creating temp dicts
for matching

174e9da083/Lib/collections/__init__.py (L1022)

We can avoid this by removing the ChainMap since there
are only two mappings to match on.

This also means options no longer obscures data

* adjust comment
2023-08-24 15:34:45 +02:00
Erik Montnemery
d282ba6bac Use a single WS command for group preview ()
* Use a single WS command for group preview

* Fix tests
2023-08-24 11:59:24 +02:00
Erik Montnemery
b885dfa5a8 Add preview to sensor group config and option flows () 2023-08-22 10:29:16 +02:00
J. Nick Koston
1adfa6bbeb Reduce overhead to start a config entry flow by optimizing fetching the handler () 2023-08-06 20:25:03 -10:00
J. Nick Koston
34b725bb99 Debounce discoveries to improve event loop stability at the started event ()
* Debounce discoveries to improve event loop stability at the started event

The first one is immediate and anything that fires within the next
second will be debounced to only happen once every second

* fix mock
2023-06-15 22:15:07 -04:00
Ville Skyttä
c7c4ee13c3 Import util.dt as dt_util in remaining tests, enforce with ruff ()
* Import `util.dt` as `dt_util` in remaining tests, enforce with ruff

* Fix `util.dt` import in pvpc_hourly_pricing tests
2023-05-30 23:30:31 +03:00
J. Nick Koston
48485fc2bf Complete persistent notifications migration ()
* Complete migration of persistent notifications

Persistent notifications are no longer stored in
the state machine and no longer fire events

* Complete migration of persistent notifications

Persistent notifications are no longer stored in
the state machine and no longer fire events

* fixes

* fixes

* fixes

* ws test

* update tests

* update tests

* fix more tests

* fix more tests

* more fixes

* fix

* fix person

* fix person

* keep whitelist

* use singleton
2023-05-25 23:09:13 -04:00
Erik Montnemery
63f3767a29 Include UUID in hassio discovery data () 2023-04-25 09:48:47 +02:00
J. Nick Koston
739963b5ee Remove deprecated async_setup_platforms () 2023-04-23 22:38:35 -05:00
epenet
3364f0fce2 Allow config entries unload action to be coroutine ()
* Allow config entries unload action to be coroutine

* Adjust comment
2023-04-17 08:41:25 -04:00
epenet
f7925763a4 Make abort_entries_match available in options flow ()
* Make abort_entries_match available in options flow

* Add tests

* Exclude ignore entries and add test

* Move to OptionsFlow

* Adjust tests

* Use mock_config_flow

* Use AbortFlow

* Remove duplicate code
2023-03-29 17:20:51 +02:00
Erik Montnemery
3931e11fd9 Try to load integration before starting option flow ()
* Try to load integration before starting option flow

* Adjust tests
2023-03-22 20:10:10 +01:00
epenet
fec6236dd9 Add type hints to root tests () 2023-03-16 11:08:47 +01:00
epenet
8a58457203 Fix lingering timer in config entries test () 2023-03-16 11:07:42 +01:00
J. Nick Koston
f8934175cb Prevent integrations from retrying setup once shutdown has started ()
* Prevent integrations from retrying setup once shutdown has started

* coverage
2023-02-26 22:01:02 -05:00
epenet
a51cc75f03 Add type hints to core tests (part 2) () 2023-02-21 09:27:13 +01:00
Paulus Schoutsen
3a32d2bdcb Add background tasks to config entries ()
* Use a set for config entries task tracking

* Allow adding background tasks to config entries

* Add tests for config entry add tasks

* Update docstrings on core create task

* Migrate roon and august

* Use in more places

* Guard for None
2023-02-17 13:50:05 -05:00
Franck Nijhof
ed79265843 Enable Ruff PT006 ()
* Enable Ruff PT006

* Adjust existing cases

* Fix tests

* Remove unneeded parentheses
2023-02-15 14:09:50 +01:00
Paulus Schoutsen
d54f59478f Keep task references while running ()
* Keep task references while running

* Update pilight tests pointing at correct logger call

* Fix graphite tests

* Fix profiler tests

* More graphite test fixes

* Remove extra sleep

* Fix tests

* Shutdown background tasks as part of stage 1

* Remove unnecessary sleep in test

* Remove unused method on mock hass

* Skip on cancelled too

* Remove background tasks

* Test trigger variables without actually sleeping

* Fix graphite

* One more graphite grrrrrrr
2023-02-13 23:16:59 -05:00
Franck Nijhof
80bf632e2d Clean up unnecessary registry mocks from helpers () 2023-02-08 20:15:29 -05:00
epenet
c98b4e3204 Add typing to tests with single hass argument (2) ()
* Add typing to tests with single hass argument (2)

* a few more
2023-02-08 08:51:43 +01:00
Franck Nijhof
5e81d28116 Update black to 23.1.0 () 2023-02-02 18:35:24 +01:00
Franck Nijhof
bfbf9b9751 Adjusts imports in tests to match our relative import rules () 2023-01-27 12:51:58 +01:00
Franck Nijhof
24fdd588fd Code styling tweaks to the tests - Part 1 () 2023-01-20 13:52:46 +01:00
Erik Montnemery
f17a829bd8 Only wait for import flows to initialize at setup ()
* Only wait for import flows to initialize at setup

* Update hassio tests

* Update hassio tests

* Apply suggestions from code review

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

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-01-18 10:44:18 +01:00
Erik Montnemery
3cd6bd87a7 Remove config entry specifics from FlowManager () 2023-01-17 15:26:17 +01:00
J. Nick Koston
4296f227cf Fix thundering heard in setup_again when there are many integrations () 2022-12-27 15:59:42 -10:00
Franck Nijhof
c715035016 Add support for raising ConfigEntryError () 2022-11-25 11:33:03 +01:00
epenet
4c38a5d773 Add OptionsFlow helper class ()
* Add OptionsFlow helper classes

* More integrations

* Adjust SchemaOptionsFlowHandler

* Use single class

* Simplify access to options

* Reduce PR

* Make _options private

* Add test
2022-11-24 12:18:09 +01:00
Jan Bouwhuis
c720742ec9 Revert (wait_for_states) and (late review) ()
* Revert "Address late review of config entry wait for states tests ()"

This reverts commit 12d76a8a4f.

* Revert "Implement ConfigEntry async_wait_for_states ()"

This reverts commit 3cc9ecf1dc.
2022-11-18 17:16:03 +01:00
Erik Montnemery
1a274adc28 Add config_entries.async_wait_component ()
Co-authored-by: thecode <levyshay1@gmail.com>
2022-11-17 21:52:57 +01:00
Aaron Bach
adf84b0c62 Add async_get_active_reauth_flows helper for config entries ()
* Add `async_get_active_reauth_flows` helper for config entries

* Code review

* Code review + tests
2022-11-09 15:36:50 -07:00
J. Nick Koston
f9ff23a2c8 Fix benign typo in test_config_entries.py ()
* Fix typo in test_config_entries.py

* touch ups

* Update tests/test_config_entries.py

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

Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-11-09 16:36:46 +01:00
Jan Bouwhuis
12d76a8a4f Address late review of config entry wait for states tests ()
* Late review on tests 

* Clean-up duplicate assignment
2022-11-08 22:14:17 +01:00
Jan Bouwhuis
3cc9ecf1dc Implement ConfigEntry async_wait_for_states ()
* Implement async_wait_for_states

* stale docstr, remove hints

* Assert return states for tests
2022-11-08 17:18:40 +01:00
J. Nick Koston
c2c26e2608 Fix check for duplicate config entry reauth when context is passed or augmented ()
fixes https://github.com/home-assistant/core/issues/77578
2022-11-07 21:19:57 -06:00
Martin Hjelmare
62c4cd3c26 Add name and slug to supervisor discovery info () 2022-10-11 16:56:45 +02:00
J. Nick Koston
74f7ae409b Add a helpful message to the config_entries.OperationNotAllowed exception ()
We only expect this exception to be raised as a result of an
implementation problem. When it is raised during production
it is currently hard to trace down why its happening

See 
2022-09-17 20:52:28 +03:00
Jc2k
a0adfb9e62 Fix serialization of Xiaomi BLE reauth flow ()
* Use data instead of context to fix serialisation bug

* Test change to async_start_reauth
2022-08-02 21:38:38 +01:00
Jc2k
f043203b56 Add optional context parameter to async_start_reauth () 2022-08-02 18:20:37 +02:00
J. Nick Koston
a697672944 Add bluetooth integration ()
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2022-07-08 18:55:31 -05:00
Franck Nijhof
a6244eea28 Search/replace RESULT_TYPE_* by FlowResultType enum () 2022-07-07 21:28:18 +02:00