mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 10:59:40 +00:00
41 lines
1.2 KiB
Python
41 lines
1.2 KiB
Python
"""Tests for the ToGrill Bluetooth integration."""
|
|
|
|
from unittest.mock import patch
|
|
|
|
from homeassistant.const import Platform
|
|
from homeassistant.core import HomeAssistant
|
|
from homeassistant.helpers.service_info.bluetooth import BluetoothServiceInfo
|
|
|
|
from tests.common import MockConfigEntry
|
|
|
|
TOGRILL_SERVICE_INFO = BluetoothServiceInfo(
|
|
name="Pro-05",
|
|
address="00000000-0000-0000-0000-000000000001",
|
|
rssi=-63,
|
|
service_data={},
|
|
manufacturer_data={34714: b"\xd9\xe3\xbe\xf3\x00"},
|
|
service_uuids=["0000cee0-0000-1000-8000-00805f9b34fb"],
|
|
source="local",
|
|
)
|
|
|
|
TOGRILL_SERVICE_INFO_NO_NAME = BluetoothServiceInfo(
|
|
name="",
|
|
address="00000000-0000-0000-0000-000000000002",
|
|
rssi=-63,
|
|
service_data={},
|
|
manufacturer_data={34714: b"\xd9\xe3\xbe\xf3\x00"},
|
|
service_uuids=["0000cee0-0000-1000-8000-00805f9b34fb"],
|
|
source="local",
|
|
)
|
|
|
|
|
|
async def setup_entry(
|
|
hass: HomeAssistant, mock_entry: MockConfigEntry, platforms: list[Platform]
|
|
) -> None:
|
|
"""Make sure the device is available."""
|
|
|
|
with patch("homeassistant.components.togrill._PLATFORMS", platforms):
|
|
mock_entry.add_to_hass(hass)
|
|
await hass.config_entries.async_setup(mock_entry.entry_id)
|
|
await hass.async_block_till_done()
|