Allow ADR 0007 compliant schema for mqtt (#94305)

* Enforce listed entities in MQTT yaml config

* Add tests for setup with listed items

* Fix test

* Remove validator add comment

* Update homeassistant/components/mqtt/__init__.py

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

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
This commit is contained in:
Jan Bouwhuis
2023-07-18 14:29:45 +02:00
committed by GitHub
parent f9a0877bb9
commit 7c22225cd1
28 changed files with 176 additions and 48 deletions

View File

@ -2441,7 +2441,11 @@ async def test_encoding_subscribable_topics(
)
@pytest.mark.parametrize("hass_config", [DEFAULT_CONFIG])
@pytest.mark.parametrize(
"hass_config",
[DEFAULT_CONFIG, {"mqtt": [DEFAULT_CONFIG["mqtt"]]}],
ids=["platform_key", "listed"],
)
async def test_setup_manual_entity_from_yaml(
hass: HomeAssistant, mqtt_mock_entry: MqttMockHAClientGenerator
) -> None: