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

Update tests i-o to use async_get() instead of async_get_registry() (#47653)

This commit is contained in:
Erik Montnemery
2021-03-09 14:32:08 +01:00
committed by GitHub
parent 87e7cebd36
commit 84226da404
36 changed files with 150 additions and 130 deletions

View File

@@ -19,7 +19,7 @@ from homeassistant.const import (
TEMP_CELSIUS,
)
from homeassistant.core import callback
from homeassistant.helpers import device_registry
from homeassistant.helpers import device_registry as dr
from homeassistant.setup import async_setup_component
from homeassistant.util.dt import utcnow
@@ -1058,7 +1058,7 @@ async def test_mqtt_ws_remove_non_mqtt_device(
device_entry = device_reg.async_get_or_create(
config_entry_id=config_entry.entry_id,
connections={(device_registry.CONNECTION_NETWORK_MAC, "12:34:56:AB:CD:EF")},
connections={(dr.CONNECTION_NETWORK_MAC, "12:34:56:AB:CD:EF")},
)
assert device_entry is not None
@@ -1157,7 +1157,7 @@ async def test_debug_info_multiple_devices(hass, mqtt_mock):
},
]
registry = await hass.helpers.device_registry.async_get_registry()
registry = dr.async_get(hass)
for d in devices:
data = json.dumps(d["config"])
@@ -1236,7 +1236,7 @@ async def test_debug_info_multiple_entities_triggers(hass, mqtt_mock):
},
]
registry = await hass.helpers.device_registry.async_get_registry()
registry = dr.async_get(hass)
for c in config:
data = json.dumps(c["config"])
@@ -1284,7 +1284,7 @@ async def test_debug_info_non_mqtt(hass, device_reg, entity_reg):
config_entry.add_to_hass(hass)
device_entry = device_reg.async_get_or_create(
config_entry_id=config_entry.entry_id,
connections={(device_registry.CONNECTION_NETWORK_MAC, "12:34:56:AB:CD:EF")},
connections={(dr.CONNECTION_NETWORK_MAC, "12:34:56:AB:CD:EF")},
)
for device_class in DEVICE_CLASSES:
entity_reg.async_get_or_create(
@@ -1311,7 +1311,7 @@ async def test_debug_info_wildcard(hass, mqtt_mock):
"unique_id": "veryunique",
}
registry = await hass.helpers.device_registry.async_get_registry()
registry = dr.async_get(hass)
data = json.dumps(config)
async_fire_mqtt_message(hass, "homeassistant/sensor/bla/config", data)
@@ -1357,7 +1357,7 @@ async def test_debug_info_filter_same(hass, mqtt_mock):
"unique_id": "veryunique",
}
registry = await hass.helpers.device_registry.async_get_registry()
registry = dr.async_get(hass)
data = json.dumps(config)
async_fire_mqtt_message(hass, "homeassistant/sensor/bla/config", data)
@@ -1416,7 +1416,7 @@ async def test_debug_info_same_topic(hass, mqtt_mock):
"unique_id": "veryunique",
}
registry = await hass.helpers.device_registry.async_get_registry()
registry = dr.async_get(hass)
data = json.dumps(config)
async_fire_mqtt_message(hass, "homeassistant/sensor/bla/config", data)
@@ -1467,7 +1467,7 @@ async def test_debug_info_qos_retain(hass, mqtt_mock):
"unique_id": "veryunique",
}
registry = await hass.helpers.device_registry.async_get_registry()
registry = dr.async_get(hass)
data = json.dumps(config)
async_fire_mqtt_message(hass, "homeassistant/sensor/bla/config", data)