hass-core/homeassistant/components/mqtt
J. Nick Koston ed0568c655
Ensure config entries are not unloaded while their platforms are setting up (#118767)
* Report non-awaited/non-locked config entry platform forwards

Its currently possible for config entries to be reloaded while their platforms
are being forwarded if platform forwards are not awaited or done after the
config entry is setup since the lock will not be held in this case.

In https://developers.home-assistant.io/blog/2022/07/08/config_entry_forwards
we advised to await platform forwards to ensure this does not happen, however
for sleeping devices and late discovered devices, platform forwards may happen
later.

If config platform forwards are happening during setup, they should be awaited

If config entry platform forwards are not happening during setup, instead
async_late_forward_entry_setups should be used which will hold the lock to
prevent the config entry from being unloaded while its platforms are being
setup

* Report non-awaited/non-locked config entry platform forwards

Its currently possible for config entries to be reloaded while their platforms
are being forwarded if platform forwards are not awaited or done after the
config entry is setup since the lock will not be held in this case.

In https://developers.home-assistant.io/blog/2022/07/08/config_entry_forwards
we advised to await platform forwards to ensure this does not happen, however
for sleeping devices and late discovered devices, platform forwards may happen
later.

If config platform forwards are happening during setup, they should be awaited

If config entry platform forwards are not happening during setup, instead
async_late_forward_entry_setups should be used which will hold the lock to
prevent the config entry from being unloaded while its platforms are being
setup

* run with error on to find them

* cert_exp, hold lock

* cert_exp, hold lock

* shelly async_late_forward_entry_setups

* compact

* compact

* found another

* patch up mobileapp

* patch up hue tests

* patch up smartthings

* fix mqtt

* fix esphome

* zwave_js

* mqtt

* rework

* fixes

* fix mocking

* fix mocking

* do not call async_forward_entry_setup directly

* docstrings

* docstrings

* docstrings

* add comments

* doc strings

* fixed all in core, turn off strict

* coverage

* coverage

* missing

* coverage
2024-06-04 21:34:39 -04:00
..
light Convert mqtt entity discovery to use callbacks (#118200) 2024-05-26 16:12:40 -10:00
__init__.py Ensure config entries are not unloaded while their platforms are setting up (#118767) 2024-06-04 21:34:39 -04:00
abbreviations.py Revert "Allow MQTT device based auto discovery" (#118746) 2024-06-03 22:30:37 +02:00
alarm_control_panel.py Convert mqtt entity discovery to use callbacks (#118200) 2024-05-26 16:12:40 -10:00
async_client.py Remove useless threading locks in mqtt (#118737) 2024-06-04 14:21:03 -05:00
binary_sensor.py Convert mqtt entity discovery to use callbacks (#118200) 2024-05-26 16:12:40 -10:00
button.py Convert mqtt entity discovery to use callbacks (#118200) 2024-05-26 16:12:40 -10:00
camera.py Convert mqtt entity discovery to use callbacks (#118200) 2024-05-26 16:12:40 -10:00
client.py Remove useless threading locks in mqtt (#118737) 2024-06-04 14:21:03 -05:00
climate.py Convert mqtt entity discovery to use callbacks (#118200) 2024-05-26 16:12:40 -10:00
config.py Add empty line after module docstring [j-m] (#112700) 2024-03-08 09:01:29 -05:00
config_flow.py Correct stale docstring on mqtt config flow method (#116848) 2024-05-05 14:06:13 +02:00
config_integration.py Add mqtt notify platform (#115653) 2024-04-17 20:07:11 +02:00
const.py Revert "Allow MQTT device based auto discovery" (#118746) 2024-06-03 22:30:37 +02:00
cover.py Convert mqtt entity discovery to use callbacks (#118200) 2024-05-26 16:12:40 -10:00
debug_info.py Replace pop calls with del where the result is discarded in mqtt (#118338) 2024-05-28 15:26:35 -10:00
device_automation.py Convert mqtt entity discovery to use callbacks (#118200) 2024-05-26 16:12:40 -10:00
device_tracker.py Convert mqtt entity discovery to use callbacks (#118200) 2024-05-26 16:12:40 -10:00
device_trigger.py Convert remaining mqtt attrs classes to dataclasses (#118073) 2024-05-24 17:44:50 -10:00
diagnostics.py Refactor MQTT to replace get_mqtt_data with HassKey (#117899) 2024-05-21 23:21:51 -10:00
discovery.py Ensure config entries are not unloaded while their platforms are setting up (#118767) 2024-06-04 21:34:39 -04:00
event.py Convert mqtt entity discovery to use callbacks (#118200) 2024-05-26 16:12:40 -10:00
fan.py Convert mqtt entity discovery to use callbacks (#118200) 2024-05-26 16:12:40 -10:00
humidifier.py Convert mqtt entity discovery to use callbacks (#118200) 2024-05-26 16:12:40 -10:00
icons.json
image.py Convert mqtt entity discovery to use callbacks (#118200) 2024-05-26 16:12:40 -10:00
lawn_mower.py Convert mqtt entity discovery to use callbacks (#118200) 2024-05-26 16:12:40 -10:00
lock.py Convert mqtt entity discovery to use callbacks (#118200) 2024-05-26 16:12:40 -10:00
manifest.json Update quality scale mqtt integration to platinum (#116059) 2024-04-23 23:20:34 +02:00
mixins.py Revert "Allow MQTT device based auto discovery" (#118746) 2024-06-03 22:30:37 +02:00
models.py Revert "Allow MQTT device based auto discovery" (#118746) 2024-06-03 22:30:37 +02:00
notify.py Convert mqtt entity discovery to use callbacks (#118200) 2024-05-26 16:12:40 -10:00
number.py Convert mqtt entity discovery to use callbacks (#118200) 2024-05-26 16:12:40 -10:00
scene.py Convert mqtt entity discovery to use callbacks (#118200) 2024-05-26 16:12:40 -10:00
schemas.py Revert "Allow MQTT device based auto discovery" (#118746) 2024-06-03 22:30:37 +02:00
select.py Convert mqtt entity discovery to use callbacks (#118200) 2024-05-26 16:12:40 -10:00
sensor.py Fix handling undecoded mqtt sensor payloads (#118633) 2024-06-02 21:25:05 +02:00
services.yaml
siren.py Convert mqtt entity discovery to use callbacks (#118200) 2024-05-26 16:12:40 -10:00
strings.json Correct typo in MQTT translations (#116956) 2024-05-06 23:21:34 +02:00
subscription.py Remove legacy mqtt debug_info implementation (#118212) 2024-05-26 21:55:54 -10:00
switch.py Convert mqtt entity discovery to use callbacks (#118200) 2024-05-26 16:12:40 -10:00
tag.py Replace pop calls with del where the result is discarded in mqtt (#118338) 2024-05-28 15:26:35 -10:00
text.py Convert mqtt entity discovery to use callbacks (#118200) 2024-05-26 16:12:40 -10:00
trigger.py Avoid expensive inspection of callbacks to setup mqtt subscriptions (#118161) 2024-05-26 01:22:44 -10:00
update.py Convert mqtt entity discovery to use callbacks (#118200) 2024-05-26 16:12:40 -10:00
util.py Ensure config entries are not unloaded while their platforms are setting up (#118767) 2024-06-04 21:34:39 -04:00
vacuum.py Convert mqtt entity discovery to use callbacks (#118200) 2024-05-26 16:12:40 -10:00
valve.py Convert mqtt entity discovery to use callbacks (#118200) 2024-05-26 16:12:40 -10:00
water_heater.py Convert mqtt entity discovery to use callbacks (#118200) 2024-05-26 16:12:40 -10:00