hass-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 Inverse json import logic (#88099) 2023-02-16 11:37:57 +01:00
__init__.py Clean up unused and deprecated TLS version setting on MQTT client (#88674) 2023-03-01 18:42:34 +01:00
abbreviations.py Add suggested_display_precision config option for MQTT sensor (#87129) 2023-02-07 08:55:35 +01:00
alarm_control_panel.py Adjust docstrings for ruff D404 (#89077) 2023-03-03 11:26:13 +01:00
binary_sensor.py Update black to 23.1.0 (#87188) 2023-02-02 18:35:24 +01:00
button.py Code styling tweaks to the MQTT integration (#85463) 2023-01-08 22:07:10 +01:00
camera.py Code styling tweaks to the MQTT integration (#85463) 2023-01-08 22:07:10 +01:00
client.py Debounce and group MQTT subscriptions (#88862) 2023-03-14 11:13:55 +01:00
climate.py Allow resetting MQTT climate attributes and ignore empty values (#87936) 2023-02-15 16:31:49 +01:00
config.py Add optimistic option for MQTT climate (#84777) 2023-01-02 11:39:42 +01:00
config_flow.py Replace deprecated SSLContext constant PROTOCOL_TLS in mqtt (#88214) 2023-02-16 13:01:28 -05:00
config_integration.py Clean up unused and deprecated TLS version setting on MQTT client (#88674) 2023-03-01 18:42:34 +01:00
const.py Clean up unused and deprecated TLS version setting on MQTT client (#88674) 2023-03-01 18:42:34 +01:00
cover.py Inverse json import logic (#88099) 2023-02-16 11:37:57 +01:00
debug_info.py Improve MQTT type hints part 3 (#80542) 2022-11-03 13:06:53 +01:00
device_automation.py Improve MQTT type hints part 3 (#80542) 2022-11-03 13:06:53 +01:00
device_tracker.py Code styling tweaks to the MQTT integration (#85463) 2023-01-08 22:07:10 +01:00
device_trigger.py Complete partly implemented type hints for dict on MQTT platforms (#87839) 2023-02-12 21:47:38 +01:00
diagnostics.py Add MqttData helper to mqtt (#78825) 2022-09-20 19:40:06 +02:00
discovery.py Inverse json import logic (#88099) 2023-02-16 11:37:57 +01:00
fan.py Code styling tweaks to the MQTT integration (#85463) 2023-01-08 22:07:10 +01:00
humidifier.py Code styling tweaks to the MQTT integration (#85463) 2023-01-08 22:07:10 +01:00
lock.py Always add code to template vars MQTT lock command template (#86460) 2023-01-23 16:08:25 +01:00
manifest.json Sort manifests 6 (#87027) 2023-02-08 20:38:43 +01:00
mixins.py Inverse json import logic (#88099) 2023-02-16 11:37:57 +01:00
models.py Catch exceptions and add logging when writing states on MQTT entities (#89091) 2023-03-06 15:34:47 +01:00
number.py Remove use of Number DEVICE_CLASSES_SCHEMA from MQTT (#87345) 2023-02-04 00:08:15 +01:00
scene.py Code styling tweaks to the MQTT integration (#85463) 2023-01-08 22:07:10 +01:00
select.py Code styling tweaks to the MQTT integration (#85463) 2023-01-08 22:07:10 +01:00
sensor.py Allow enum as MQTT sensor device_class (#89391) 2023-03-08 22:35:06 +01:00
services.yaml
siren.py Inverse json import logic (#88099) 2023-02-16 11:37:57 +01:00
strings.json Allow translating select selector options (#85531) 2023-01-17 16:22:19 +01:00
subscription.py Update black to 23.1.0 (#87188) 2023-02-02 18:35:24 +01:00
switch.py Code styling tweaks to the MQTT integration (#85463) 2023-01-08 22:07:10 +01:00
tag.py Complete partly implemented type hints for dict on MQTT platforms (#87839) 2023-02-12 21:47:38 +01:00
text.py Improve MQTT Callable type hints (#87838) 2023-02-12 21:24:59 +01:00
trigger.py Inverse json import logic (#88099) 2023-02-16 11:37:57 +01:00
update.py Inverse json import logic (#88099) 2023-02-16 11:37:57 +01:00
util.py Fix can not typo (#87254) 2023-02-03 11:37:16 +01:00