From bf07a79e3a53925e9f2d03861f8156c316b95315 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Tue, 27 Jan 2026 17:02:10 +0100 Subject: [PATCH] Add SmartThings device info from device identification (#161688) --- homeassistant/components/smartthings/__init__.py | 13 +++++++++++++ .../components/smartthings/snapshots/test_init.ambr | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/smartthings/__init__.py b/homeassistant/components/smartthings/__init__.py index 10f21fcc7ee..ae177162f26 100644 --- a/homeassistant/components/smartthings/__init__.py +++ b/homeassistant/components/smartthings/__init__.py @@ -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 diff --git a/tests/components/smartthings/snapshots/test_init.ambr b/tests/components/smartthings/snapshots/test_init.ambr index 6b22a71c221..466e16cea29 100644 --- a/tests/components/smartthings/snapshots/test_init.ambr +++ b/tests/components/smartthings/snapshots/test_init.ambr @@ -613,11 +613,11 @@ }), 'manufacturer': None, 'model': None, - 'model_id': None, + 'model_id': 'NZ64B5046GK', 'name': 'Induction Hob', 'name_by_user': None, 'primary_config_entry': , - 'serial_number': None, + 'serial_number': 'B8C878DX900290H', 'sw_version': None, 'via_device_id': None, })