1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Move MQTT discovery hass.data globals to dataclass (#78706)

* Add MQTT discovery hass.data globals to dataclass

* isort

* Additional rework

* Add hass.data["mqtt_tags"] to dataclass

* Follow-up comment

* Corrections
This commit is contained in:
Jan Bouwhuis
2022-09-28 14:13:44 +02:00
committed by GitHub
parent a38c125765
commit 84b2c74746
9 changed files with 120 additions and 86 deletions

View File

@@ -186,7 +186,18 @@ async def test_manual_config_set(
"discovery": True,
}
# Check we tried the connection, with precedence for config entry settings
mock_try_connection.assert_called_once_with(hass, "127.0.0.1", 1883, None, None)
mock_try_connection.assert_called_once_with(
{
"broker": "bla",
"keepalive": 60,
"discovery_prefix": "homeassistant",
"protocol": "3.1.1",
},
"127.0.0.1",
1883,
None,
None,
)
# Check config entry got setup
assert len(mock_finish_setup.mock_calls) == 1
config_entry = hass.config_entries.async_entries(mqtt.DOMAIN)[0]