Add SmartThings hub connections (#139549)

pull/135223/head
Joost Lekkerkerker 2025-02-28 23:32:09 +01:00 committed by GitHub
parent 577b22374a
commit d6750624ce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 2 deletions

View File

@ -103,10 +103,16 @@ async def async_setup_entry(hass: HomeAssistant, entry: SmartThingsConfigEntry)
for dev in device_status.values():
for component in dev.device.components:
if component.id == MAIN and Capability.BRIDGE in component.capabilities:
assert dev.device.hub
device_registry.async_get_or_create(
config_entry_id=entry.entry_id,
identifiers={(DOMAIN, dev.device.device_id)},
connections={
(dr.CONNECTION_NETWORK_MAC, dev.device.hub.mac_address)
},
name=dev.device.label,
sw_version=dev.device.hub.firmware_version,
model=dev.device.hub.hardware_type,
)
scenes = {
scene.scene_id: scene

View File

@ -1029,6 +1029,10 @@
'config_entries_subentries': <ANY>,
'configuration_url': None,
'connections': set({
tuple(
'mac',
'd0:52:a8:72:91:02',
),
}),
'disabled_by': None,
'entry_type': None,
@ -1044,14 +1048,14 @@
'labels': set({
}),
'manufacturer': None,
'model': None,
'model': 'V2_HUB',
'model_id': None,
'name': 'Home Hub',
'name_by_user': None,
'primary_config_entry': <ANY>,
'serial_number': None,
'suggested_area': None,
'sw_version': None,
'sw_version': '000.055.00005',
'via_device_id': None,
})
# ---