mirror of
https://github.com/home-assistant/core.git
synced 2025-08-01 03:35:09 +02:00
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:
@@ -72,6 +72,7 @@ from .test_common import (
|
||||
help_test_setting_blocked_attribute_via_mqtt_json_message,
|
||||
help_test_setup_manual_entity_from_yaml,
|
||||
help_test_unique_id,
|
||||
help_test_unload_config_entry_with_platform,
|
||||
help_test_update_with_json_attrs_bad_JSON,
|
||||
help_test_update_with_json_attrs_not_dict,
|
||||
)
|
||||
@@ -1266,3 +1267,12 @@ async def test_setup_manual_entity_from_yaml(hass):
|
||||
del config["platform"]
|
||||
await help_test_setup_manual_entity_from_yaml(hass, platform, config)
|
||||
assert hass.states.get(f"{platform}.test") is not None
|
||||
|
||||
|
||||
async def test_unload_entry(hass, mqtt_mock_entry_with_yaml_config, tmp_path):
|
||||
"""Test unloading the config entry."""
|
||||
domain = light.DOMAIN
|
||||
config = DEFAULT_CONFIG[domain]
|
||||
await help_test_unload_config_entry_with_platform(
|
||||
hass, mqtt_mock_entry_with_yaml_config, tmp_path, domain, config
|
||||
)
|
||||
|
Reference in New Issue
Block a user