1
0
mirror of https://github.com/home-assistant/core.git synced 2026-07-03 04:36:04 +01:00
Files
jasonjhofmann 34d175e452 Add Bluetooth connection to Melnor devices (#173669)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 20:27:19 +02:00

38 lines
1.0 KiB
Python

"""Test the Melnor integration setup."""
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.melnor.const import DOMAIN
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as dr
from .conftest import (
FAKE_ADDRESS_1,
mock_config_entry,
patch_async_ble_device_from_address,
patch_async_register_callback,
patch_melnor_device,
)
async def test_device_registry(
hass: HomeAssistant,
device_registry: dr.DeviceRegistry,
snapshot: SnapshotAssertion,
) -> None:
"""Test the device registry entry, including the Bluetooth connection."""
entry = mock_config_entry(hass)
with (
patch_async_ble_device_from_address(),
patch_melnor_device(),
patch_async_register_callback(),
):
assert await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
device_entry = device_registry.async_get_device(
identifiers={(DOMAIN, FAKE_ADDRESS_1)}
)
assert device_entry == snapshot