mirror of
https://github.com/Electric-Special/ha-core.git
synced 2026-03-21 04:05:20 +01:00
Add SmartThings device info from device identification (#161688)
This commit is contained in:
committed by
GitHub
parent
6fd2d74539
commit
bf07a79e3a
@@ -517,6 +517,19 @@ def create_devices(
|
||||
ATTR_SERIAL_NUMBER: matter.serial_number,
|
||||
}
|
||||
)
|
||||
if (main_component := device.status.get(MAIN)) is not None and (
|
||||
device_identification := main_component.get(
|
||||
Capability.SAMSUNG_CE_DEVICE_IDENTIFICATION
|
||||
)
|
||||
) is not None:
|
||||
new_kwargs = {
|
||||
ATTR_SERIAL_NUMBER: device_identification[Attribute.SERIAL_NUMBER].value
|
||||
}
|
||||
if ATTR_MODEL_ID not in kwargs:
|
||||
new_kwargs[ATTR_MODEL_ID] = device_identification[
|
||||
Attribute.MODEL_NAME
|
||||
].value
|
||||
kwargs.update(new_kwargs)
|
||||
if (
|
||||
device_registry.async_get_device({(DOMAIN, device.device.device_id)})
|
||||
is None
|
||||
|
||||
@@ -613,11 +613,11 @@
|
||||
}),
|
||||
'manufacturer': None,
|
||||
'model': None,
|
||||
'model_id': None,
|
||||
'model_id': 'NZ64B5046GK',
|
||||
'name': 'Induction Hob',
|
||||
'name_by_user': None,
|
||||
'primary_config_entry': <ANY>,
|
||||
'serial_number': None,
|
||||
'serial_number': 'B8C878DX900290H',
|
||||
'sw_version': None,
|
||||
'via_device_id': None,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user