core/homeassistant/components/mqtt
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
..
light Improve warnings in mqtt light messages (#89552) 2023-03-13 14:46:16 +01:00
vacuum
__init__.py
abbreviations.py
alarm_control_panel.py
binary_sensor.py
button.py
camera.py
client.py Debounce and group MQTT subscriptions (#88862) 2023-03-14 11:13:55 +01:00
climate.py
config.py
config_flow.py
config_integration.py
const.py
cover.py
debug_info.py
device_automation.py
device_tracker.py
device_trigger.py
diagnostics.py
discovery.py
fan.py
humidifier.py
lock.py
manifest.json
mixins.py
models.py Catch exceptions and add logging when writing states on MQTT entities (#89091) 2023-03-06 15:34:47 +01:00
number.py
scene.py
select.py
sensor.py Allow enum as MQTT sensor device_class (#89391) 2023-03-08 22:35:06 +01:00
services.yaml
siren.py
strings.json
subscription.py
switch.py
tag.py
text.py
trigger.py
update.py
util.py