hass-core/homeassistant
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 Adjust entity registry access in core platforms (#88944) 2023-03-01 08:02:16 +01:00
backports Add Self typing (1) [mypy 1.0] (#87598) 2023-02-06 22:29:47 -06:00
brands Add virtual integration for HELTUN (#88892) 2023-02-28 18:09:52 +01:00
components Debounce and group MQTT subscriptions (#88862) 2023-03-14 11:13:55 +01:00
generated Add ESERA 1-Wire virtual integration (#89487) 2023-03-13 11:33:35 +01:00
helpers Add is_hidden_entity test for Jinja templates (#89011) 2023-03-13 18:20:33 +01:00
scripts Adjust registry access in scripts (#88884) 2023-02-28 21:58:47 -05:00
util Reduce overhead to store context ids in the database (#88942) 2023-03-08 14:51:45 -10:00
__init__.py
__main__.py Stricter pylint message control (#86154) 2023-01-20 13:47:55 +01:00
block_async_io.py Update mypy to 1.1.1 (#89268) 2023-03-08 22:57:54 +01:00
bootstrap.py Add an in-memory-preloading loader for Jinja imports (#88850) 2023-03-13 11:00:05 +01:00
config.py Enable T20 (flake8-print) to ban use of print statements (#86525) 2023-01-24 14:24:21 +01:00
config_entries.py Add names to the config entry setup and shutdown tasks (#89309) 2023-03-08 10:19:36 -05:00
const.py Bump version to 2023.4.0dev0 (#88630) 2023-02-22 21:29:49 +01:00
core.py Fix missing f-string in filterable_job (#89340) 2023-03-08 15:53:48 -05:00
data_entry_flow.py Dismiss discoveries when the underlying device disappears (#88340) 2023-02-17 15:51:19 -05:00
exceptions.py Fix can not typo (#87254) 2023-02-03 11:37:16 +01:00
loader.py Inverse json import logic (#88099) 2023-02-16 11:37:57 +01:00
package_constraints.txt Bump ulid-transform to 0.4.2 (#89666) 2023-03-13 20:52:27 -04:00
requirements.py Core code styling improvements (#85963) 2023-01-15 23:00:51 +01:00
runner.py Update mypy to 1.1.1 (#89268) 2023-03-08 22:57:54 +01:00
setup.py Add names to the config entry setup and shutdown tasks (#89309) 2023-03-08 10:19:36 -05:00
strings.json Add a timeout during OAuth token exchange and additional debug logging (#85911) 2023-01-16 19:52:43 +01:00