Mqtt support config_entry unload (#70149)

* squashed commits for rebase

* Flake

* Fix reloading issue manual legacy items

* Improve ACS sync for unsubscribe at disconnect

* Processed review comments

* Update homeassistant/components/mqtt/client.py

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

* No need to await entry setup

* Remove complication is_connected

* Update homeassistant/components/mqtt/__init__.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>
This commit is contained in:
Jan Bouwhuis 2022-07-12 11:07:18 +02:00 committed by GitHub
parent 6a37600936
commit 5930f056a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
49 changed files with 1107 additions and 124 deletions

View file

@ -112,8 +112,12 @@ async def async_setup_entry(
async def _async_setup_entity(
hass, async_add_entities, config, config_entry=None, discovery_data=None
):
hass: HomeAssistant,
async_add_entities: AddEntitiesCallback,
config: ConfigType,
config_entry: ConfigEntry | None = None,
discovery_data: dict | None = None,
) -> None:
"""Set up the MQTT binary sensor."""
async_add_entities([MqttBinarySensor(hass, config, config_entry, discovery_data)])