Remove legacy YAML support from MQTT (#82102)

This commit is contained in:
Jan Bouwhuis
2022-11-17 22:55:31 +01:00
committed by GitHub
parent f82c4c7633
commit 7c2e7863d2
46 changed files with 54 additions and 1613 deletions

View File

@ -119,7 +119,6 @@ from .test_common import (
help_test_entity_id_update_subscriptions,
help_test_publishing_with_custom_encoding,
help_test_reloadable,
help_test_reloadable_late,
help_test_setting_attribute_via_mqtt_json_message,
help_test_setting_attribute_with_template,
help_test_setting_blocked_attribute_via_mqtt_json_message,
@ -142,11 +141,6 @@ DEFAULT_CONFIG = {
}
}
# Test deprecated YAML configuration under the platform key
# Scheduled to be removed in HA core 2022.12
DEFAULT_CONFIG_LEGACY = copy.deepcopy(DEFAULT_CONFIG[mqtt.DOMAIN])
DEFAULT_CONFIG_LEGACY[light.DOMAIN]["platform"] = mqtt.DOMAIN
@pytest.fixture(autouse=True)
def light_platform_only():
@ -2205,15 +2199,6 @@ async def test_reloadable(hass, mqtt_mock_entry_with_yaml_config, caplog, tmp_pa
)
# Test deprecated YAML configuration under the platform key
# Scheduled to be removed in HA core 2022.12
async def test_reloadable_late(hass, mqtt_client_mock, caplog, tmp_path):
"""Test reloading the MQTT platform with late entry setup."""
domain = light.DOMAIN
config = DEFAULT_CONFIG_LEGACY[domain]
await help_test_reloadable_late(hass, caplog, tmp_path, domain, config)
@pytest.mark.parametrize(
"topic,value,attribute,attribute_value,init_payload",
[
@ -2267,16 +2252,3 @@ async def test_setup_manual_entity_from_yaml(hass):
platform = light.DOMAIN
await help_test_setup_manual_entity_from_yaml(hass, DEFAULT_CONFIG)
assert hass.states.get(f"{platform}.test")
# Test deprecated YAML configuration under the platform key
# Scheduled to be removed in HA core 2022.12
async def test_setup_with_legacy_schema(hass, mqtt_mock_entry_with_yaml_config):
"""Test a setup with deprecated yaml platform schema."""
domain = light.DOMAIN
config = copy.deepcopy(DEFAULT_CONFIG_LEGACY[domain])
config["name"] = "test"
assert await async_setup_component(hass, domain, {domain: config})
await hass.async_block_till_done()
await mqtt_mock_entry_with_yaml_config()
assert hass.states.get(f"{domain}.test") is not None