hass-core/tests
Jan Bouwhuis ec1b8b616f
Debounce and group MQTT subscriptions (#88862)
* Debounce and group mqtt subscriptions

* Cleanup

* Do not cooldown on resubscribe

* Remove lock from task

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

* ruff

* Longer initial cool down. Manages unsubscribes

* Own lock for access to self._pending_subscriptions

* adjust

* Subscribe to highest QoS when sharing subscription

* do not block _pending_subscriptions_lock with io

* Test the highest qos is subscribed at

* Cleanup max qos

* Follow up comments part 1

* Make docstr more generic

* Make max qos update thread safe

* Add lock on clearing _max_qos when resubscribing

* Wait for linger task

* User copy

* Check for key before cleaning up

* Fix lingering task

* Do not use a lock

* do not await _async_queue_subscriptions

* Replace copy with assignment

* Update max qos before returning

* Do not iterate if max_qos == 0

* Do not ieterate subs if max qos == 0

* Set initial cooldown correctly

* Ensure discovery cooldown ends after subscribing

* plan last subscribe with debouncer timeout

* cooldown if self._pending_subscriptions is set

* Revert format changes

* Remove stale assingnment self._last_subscribe

* Remove not used property

* Also check while for pending subscriptions

* revert first added sleep()

* Optimize

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-03-14 11:13:55 +01:00
..
auth Add type hints to core tests (part 2) (#88492) 2023-02-21 09:27:13 +01:00
backports Add return type to tests without arguments (#87613) 2023-02-07 14:20:06 +01:00
components Debounce and group MQTT subscriptions (#88862) 2023-03-14 11:13:55 +01:00
fixtures Unblock JSON CI by fixing improperly indented JSON in test fixture (#88803) 2023-02-26 14:41:16 -06:00
hassfest Add type hints to core tests (#88478) 2023-02-20 11:42:56 +01:00
helpers Add is_hidden_entity test for Jinja templates (#89011) 2023-03-13 18:20:33 +01:00
pylint Enable Ruff PT006 (#88165) 2023-02-15 14:09:50 +01:00
resources
scripts Allow parameterizing YAML config in tests (#87981) 2023-02-20 16:57:12 +01:00
test_util Adjust json imports in tests (#88248) 2023-02-17 19:13:48 +01:00
testing_config Add an in-memory-preloading loader for Jinja imports (#88850) 2023-03-13 11:00:05 +01:00
util Add type hints to tests (#89497) 2023-03-10 12:06:50 +01:00
__init__.py
asyncio_legacy.py Add python 3.11 to the CI (#88038) 2023-02-16 12:38:32 -05:00
bandit.yaml
common.py Pass a helpful name when creating common asyncio tasks in core (#89171) 2023-03-05 12:46:02 +01:00
conftest.py Improve reliability of context id migration (#89609) 2023-03-12 21:41:48 -04:00
ignore_uncaught_exceptions.py
ruff.toml Enable Ruff PT006 (#88165) 2023-02-15 14:09:50 +01:00
syrupy.py Update entity registry snapshot serializer (#88566) 2023-02-21 22:37:13 +01:00
test_bootstrap.py Add type hints to core tests (part 2) (#88492) 2023-02-21 09:27:13 +01:00
test_config.py Add type hints to core tests (part 2) (#88492) 2023-02-21 09:27:13 +01:00
test_config_entries.py Prevent integrations from retrying setup once shutdown has started (#88818) 2023-02-26 22:01:02 -05:00
test_core.py Add type hints to tests (#89497) 2023-03-10 12:06:50 +01:00
test_data_entry_flow.py Add type hints to core tests (part 2) (#88492) 2023-02-21 09:27:13 +01:00
test_exceptions.py Enable Ruff PT006 (#88165) 2023-02-15 14:09:50 +01:00
test_loader.py Add type hints to core tests (part 2) (#88492) 2023-02-21 09:27:13 +01:00
test_main.py Add type hints to core tests (part 2) (#88492) 2023-02-21 09:27:13 +01:00
test_requirements.py Add type hints to core tests (part 2) (#88492) 2023-02-21 09:27:13 +01:00
test_runner.py Bump ruff to 0.0.253 (#89211) 2023-03-06 16:16:31 +01:00
test_setup.py Add type hints to core tests (part 2) (#88492) 2023-02-21 09:27:13 +01:00
test_test_fixtures.py Add type hints to core tests (part 2) (#88492) 2023-02-21 09:27:13 +01:00
typing.py Add MockHAClientWebSocket test helper (#87832) 2023-02-10 10:23:26 -05:00