mirror of
https://github.com/home-assistant/core.git
synced 2025-11-16 14:30:22 +00:00
Use registry fixtures in tests (r) (#118293)
This commit is contained in:
@@ -480,7 +480,9 @@ async def test_default_keepalive(
|
||||
assert "TCP Keepalive IDLE timer was provided" not in caplog.text
|
||||
|
||||
|
||||
async def test_unique_id(hass: HomeAssistant, monkeypatch) -> None:
|
||||
async def test_unique_id(
|
||||
hass: HomeAssistant, entity_registry: er.EntityRegistry, monkeypatch
|
||||
) -> None:
|
||||
"""Validate the device unique_id."""
|
||||
|
||||
DOMAIN = "sensor"
|
||||
@@ -503,15 +505,13 @@ async def test_unique_id(hass: HomeAssistant, monkeypatch) -> None:
|
||||
},
|
||||
}
|
||||
|
||||
registry = er.async_get(hass)
|
||||
|
||||
# setup mocking rflink module
|
||||
event_callback, _, _, _ = await mock_rflink(hass, config, DOMAIN, monkeypatch)
|
||||
|
||||
humidity_entry = registry.async_get("sensor.humidity_device")
|
||||
humidity_entry = entity_registry.async_get("sensor.humidity_device")
|
||||
assert humidity_entry
|
||||
assert humidity_entry.unique_id == "my_humidity_device_unique_id"
|
||||
|
||||
temperature_entry = registry.async_get("sensor.temperature_device")
|
||||
temperature_entry = entity_registry.async_get("sensor.temperature_device")
|
||||
assert temperature_entry
|
||||
assert temperature_entry.unique_id == "my_temperature_device_unique_id"
|
||||
|
||||
Reference in New Issue
Block a user