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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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]