Adjust mqtt tests which create devices (#98202)

This commit is contained in:
Erik Montnemery 2023-08-10 18:23:55 +02:00 committed by GitHub
parent 0b69f37d57
commit 13a9b83ed3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -48,7 +48,7 @@ from .test_common import (
help_test_update_with_json_attrs_not_dict,
)
from tests.common import async_fire_mqtt_message
from tests.common import MockConfigEntry, async_fire_mqtt_message
from tests.typing import MqttMockHAClientGenerator, MqttMockPahoClient
DEFAULT_CONFIG = {
@ -503,9 +503,11 @@ async def test_entity_device_info_with_hub(
) -> None:
"""Test MQTT event device registry integration."""
await mqtt_mock_entry()
other_config_entry = MockConfigEntry()
other_config_entry.add_to_hass(hass)
registry = dr.async_get(hass)
hub = registry.async_get_or_create(
config_entry_id="123",
config_entry_id=other_config_entry.entry_id,
connections=set(),
identifiers={("mqtt", "hub-id")},
manufacturer="manufacturer",