Skip to content

Commit 4257435

Browse files
authored
Add Matter info to SmartThings Device (home-assistant#157321)
1 parent a6aab08 commit 4257435

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

homeassistant/components/smartthings/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
ATTR_MANUFACTURER,
3535
ATTR_MODEL,
3636
ATTR_MODEL_ID,
37+
ATTR_SERIAL_NUMBER,
3738
ATTR_SUGGESTED_AREA,
3839
ATTR_SW_VERSION,
3940
ATTR_VIA_DEVICE,
@@ -479,6 +480,14 @@ def create_devices(
479480
ATTR_SW_VERSION: viper.software_version,
480481
}
481482
)
483+
if (matter := device.device.matter) is not None:
484+
kwargs.update(
485+
{
486+
ATTR_HW_VERSION: matter.hardware_version,
487+
ATTR_SW_VERSION: matter.software_version,
488+
ATTR_SERIAL_NUMBER: matter.serial_number,
489+
}
490+
)
482491
if (
483492
device_registry.async_get_device({(DOMAIN, device.device.device_id)})
484493
is None

tests/components/smartthings/snapshots/test_init.ambr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@
198198
}),
199199
'disabled_by': None,
200200
'entry_type': None,
201-
'hw_version': None,
201+
'hw_version': '1.2.0',
202202
'id': <ANY>,
203203
'identifiers': set({
204204
tuple(
@@ -214,8 +214,8 @@
214214
'name': 'Radiator Thermostat II [+M] Wohnzimmer',
215215
'name_by_user': None,
216216
'primary_config_entry': <ANY>,
217-
'serial_number': None,
218-
'sw_version': None,
217+
'serial_number': 'D44867FFFEB37584',
218+
'sw_version': '2.00.09',
219219
'via_device_id': None,
220220
})
221221
# ---

0 commit comments

Comments
 (0)