Add SmartThings hub connections (#139549)

This commit is contained in:
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 dev in device_status.values():
for component in dev.device.components: for component in dev.device.components:
if component.id == MAIN and Capability.BRIDGE in component.capabilities: if component.id == MAIN and Capability.BRIDGE in component.capabilities:
assert dev.device.hub
device_registry.async_get_or_create( device_registry.async_get_or_create(
config_entry_id=entry.entry_id, config_entry_id=entry.entry_id,
identifiers={(DOMAIN, dev.device.device_id)}, identifiers={(DOMAIN, dev.device.device_id)},
connections={
(dr.CONNECTION_NETWORK_MAC, dev.device.hub.mac_address)
},
name=dev.device.label, name=dev.device.label,
sw_version=dev.device.hub.firmware_version,
model=dev.device.hub.hardware_type,
) )
scenes = { scenes = {
scene.scene_id: scene scene.scene_id: scene

View File

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