mirror of
https://github.com/home-assistant/core.git
synced 2025-09-07 22:01:34 +02:00
feat: switch to model id for togrill (#150750)
This commit is contained in:
@@ -100,7 +100,7 @@ class ToGrillCoordinator(DataUpdateCoordinator[dict[int, Packet]]):
|
||||
config_entry_id=config_entry.entry_id,
|
||||
connections={(CONNECTION_BLUETOOTH, self.address)},
|
||||
name=config_entry.data[CONF_MODEL],
|
||||
model=config_entry.data[CONF_MODEL],
|
||||
model_id=config_entry.data[CONF_MODEL],
|
||||
sw_version=get_version_string(packet_a0),
|
||||
)
|
||||
|
||||
|
32
tests/components/togrill/snapshots/test_init.ambr
Normal file
32
tests/components/togrill/snapshots/test_init.ambr
Normal file
@@ -0,0 +1,32 @@
|
||||
# serializer version: 1
|
||||
# name: test_setup_device_present
|
||||
DeviceRegistryEntrySnapshot({
|
||||
'area_id': None,
|
||||
'config_entries': <ANY>,
|
||||
'config_entries_subentries': <ANY>,
|
||||
'configuration_url': None,
|
||||
'connections': set({
|
||||
tuple(
|
||||
'bluetooth',
|
||||
'00000000-0000-0000-0000-000000000001',
|
||||
),
|
||||
}),
|
||||
'disabled_by': None,
|
||||
'entry_type': None,
|
||||
'hw_version': None,
|
||||
'id': <ANY>,
|
||||
'identifiers': set({
|
||||
}),
|
||||
'labels': set({
|
||||
}),
|
||||
'manufacturer': None,
|
||||
'model': None,
|
||||
'model_id': 'Pro-05',
|
||||
'name': 'Pro-05',
|
||||
'name_by_user': None,
|
||||
'primary_config_entry': <ANY>,
|
||||
'serial_number': None,
|
||||
'sw_version': '0.0',
|
||||
'via_device_id': None,
|
||||
})
|
||||
# ---
|
@@ -7,6 +7,7 @@ from syrupy.assertion import SnapshotAssertion
|
||||
|
||||
from homeassistant.config_entries import ConfigEntryState
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers import device_registry as dr
|
||||
|
||||
from . import TOGRILL_SERVICE_INFO, setup_entry
|
||||
|
||||
@@ -20,6 +21,7 @@ async def test_setup_device_present(
|
||||
mock_entry: MockConfigEntry,
|
||||
mock_client: Mock,
|
||||
mock_client_class: Mock,
|
||||
device_registry: dr.DeviceRegistry,
|
||||
) -> None:
|
||||
"""Test that setup works with device present."""
|
||||
|
||||
@@ -28,6 +30,11 @@ async def test_setup_device_present(
|
||||
await setup_entry(hass, mock_entry, [])
|
||||
assert mock_entry.state is ConfigEntryState.LOADED
|
||||
|
||||
device = device_registry.async_get_device(
|
||||
connections={(dr.CONNECTION_BLUETOOTH, TOGRILL_SERVICE_INFO.address)}
|
||||
)
|
||||
assert device == snapshot
|
||||
|
||||
|
||||
async def test_setup_device_not_present(
|
||||
hass: HomeAssistant,
|
||||
|
Reference in New Issue
Block a user