Skip to content

Commit 8c4eec2

Browse files
joostlekfrenck
authored andcommitted
Don't create entities for Smartthings smarttags (home-assistant#145066)
1 parent 621a14d commit 8c4eec2

File tree

5 files changed

+358
-0
lines changed

5 files changed

+358
-0
lines changed

homeassistant/components/smartthings/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from pysmartthings import (
1414
Attribute,
1515
Capability,
16+
Category,
1617
ComponentStatus,
1718
Device,
1819
DeviceEvent,
@@ -194,6 +195,16 @@ def _handle_new_subscription_identifier(identifier: str | None) -> None:
194195
}
195196
devices = await client.get_devices()
196197
for device in devices:
198+
if (
199+
(main_component := device.components.get(MAIN)) is not None
200+
and main_component.manufacturer_category is Category.BLUETOOTH_TRACKER
201+
):
202+
device_status[device.device_id] = FullDevice(
203+
device=device,
204+
status={},
205+
online=True,
206+
)
207+
continue
197208
status = process_status(await client.get_device_status(device.device_id))
198209
online = await client.get_device_health(device.device_id)
199210
device_status[device.device_id] = FullDevice(

tests/components/smartthings/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ def mock_smartthings() -> Generator[AsyncMock]:
150150
"generic_ef00_v1",
151151
"bosch_radiator_thermostat_ii",
152152
"im_speaker_ai_0001",
153+
"im_smarttag2_ble_uwb",
153154
"abl_light_b_001",
154155
"tplink_p110",
155156
"ikea_kadrilj",
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
{
2+
"components": {
3+
"main": {
4+
"tag.e2eEncryption": {
5+
"encryption": {
6+
"value": null
7+
}
8+
},
9+
"audioVolume": {
10+
"volume": {
11+
"value": null
12+
}
13+
},
14+
"geofence": {
15+
"enableState": {
16+
"value": null
17+
},
18+
"geofence": {
19+
"value": null
20+
},
21+
"name": {
22+
"value": null
23+
}
24+
},
25+
"tag.updatedInfo": {
26+
"connection": {
27+
"value": "connected",
28+
"timestamp": "2024-02-27T17:44:57.638Z"
29+
}
30+
},
31+
"tag.factoryReset": {},
32+
"battery": {
33+
"quantity": {
34+
"value": null
35+
},
36+
"battery": {
37+
"value": null
38+
},
39+
"type": {
40+
"value": null
41+
}
42+
},
43+
"firmwareUpdate": {
44+
"lastUpdateStatusReason": {
45+
"value": null
46+
},
47+
"availableVersion": {
48+
"value": null
49+
},
50+
"lastUpdateStatus": {
51+
"value": null
52+
},
53+
"supportedCommands": {
54+
"value": null
55+
},
56+
"state": {
57+
"value": null
58+
},
59+
"updateAvailable": {
60+
"value": false,
61+
"timestamp": "2024-06-25T05:56:22.227Z"
62+
},
63+
"currentVersion": {
64+
"value": null
65+
},
66+
"lastUpdateTime": {
67+
"value": null
68+
}
69+
},
70+
"tag.searchingStatus": {
71+
"searchingStatus": {
72+
"value": null
73+
}
74+
},
75+
"tag.tagStatus": {
76+
"connectedUserId": {
77+
"value": null
78+
},
79+
"tagStatus": {
80+
"value": null
81+
},
82+
"connectedDeviceId": {
83+
"value": null
84+
}
85+
},
86+
"alarm": {
87+
"alarm": {
88+
"value": null
89+
}
90+
},
91+
"tag.tagButton": {
92+
"tagButton": {
93+
"value": null
94+
}
95+
},
96+
"tag.uwbActivation": {
97+
"uwbActivation": {
98+
"value": null
99+
}
100+
},
101+
"geolocation": {
102+
"method": {
103+
"value": null
104+
},
105+
"heading": {
106+
"value": null
107+
},
108+
"latitude": {
109+
"value": null
110+
},
111+
"accuracy": {
112+
"value": null
113+
},
114+
"altitudeAccuracy": {
115+
"value": null
116+
},
117+
"speed": {
118+
"value": null
119+
},
120+
"longitude": {
121+
"value": null
122+
},
123+
"lastUpdateTime": {
124+
"value": null
125+
}
126+
}
127+
}
128+
}
129+
}
Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
{
2+
"items": [
3+
{
4+
"deviceId": "83d660e4-b0c8-4881-a674-d9f1730366c1",
5+
"name": "Tag(UWB)",
6+
"label": "SmartTag+ black",
7+
"manufacturerName": "Samsung Electronics",
8+
"presentationId": "IM-SmartTag-BLE-UWB",
9+
"deviceManufacturerCode": "Samsung Electronics",
10+
"locationId": "redacted_locid",
11+
"ownerId": "redacted",
12+
"roomId": "redacted_roomid",
13+
"components": [
14+
{
15+
"id": "main",
16+
"label": "main",
17+
"capabilities": [
18+
{
19+
"id": "alarm",
20+
"version": 1
21+
},
22+
{
23+
"id": "tag.tagButton",
24+
"version": 1
25+
},
26+
{
27+
"id": "audioVolume",
28+
"version": 1
29+
},
30+
{
31+
"id": "battery",
32+
"version": 1
33+
},
34+
{
35+
"id": "tag.factoryReset",
36+
"version": 1
37+
},
38+
{
39+
"id": "tag.e2eEncryption",
40+
"version": 1
41+
},
42+
{
43+
"id": "tag.tagStatus",
44+
"version": 1
45+
},
46+
{
47+
"id": "geolocation",
48+
"version": 1
49+
},
50+
{
51+
"id": "geofence",
52+
"version": 1
53+
},
54+
{
55+
"id": "tag.uwbActivation",
56+
"version": 1
57+
},
58+
{
59+
"id": "tag.updatedInfo",
60+
"version": 1
61+
},
62+
{
63+
"id": "tag.searchingStatus",
64+
"version": 1
65+
},
66+
{
67+
"id": "firmwareUpdate",
68+
"version": 1
69+
}
70+
],
71+
"categories": [
72+
{
73+
"name": "BluetoothTracker",
74+
"categoryType": "manufacturer"
75+
}
76+
]
77+
}
78+
],
79+
"createTime": "2023-05-25T09:42:59.720Z",
80+
"profile": {
81+
"id": "e443f3e8-a926-3deb-917c-e5c6de3af70f"
82+
},
83+
"bleD2D": {
84+
"encryptionKey": "ZTbd_04NISrhQODE7_i8JdcG2ZWwqmUfY60taptK7J0=",
85+
"cipher": "AES_128-CBC-PKCS7Padding",
86+
"identifier": "415D4Y16F97F",
87+
"configurationVersion": "2.0",
88+
"configurationUrl": "https://apis.samsungiotcloud.com/v1/miniature/profile/b8e65e7e-6152-4704-b9f5-f16352034237",
89+
"bleDeviceType": "BLE",
90+
"metadata": {
91+
"regionCode": 11,
92+
"privacyIdPoolSize": 2000,
93+
"privacyIdSeed": "AAAAAAAX8IQ=",
94+
"privacyIdInitialVector": "ZfqZKLRGSeCwgNhdqHFRpw==",
95+
"numAllowableConnections": 2,
96+
"firmware": {
97+
"version": "1.03.07",
98+
"specVersion": "0.5.6",
99+
"updateTime": 1685007914000,
100+
"latestFirmware": {
101+
"id": 581,
102+
"version": "1.03.07",
103+
"data": {
104+
"checksum": "50E7",
105+
"size": "586004",
106+
"supportedVersion": "0.5.6"
107+
}
108+
}
109+
},
110+
"currentServerTime": 1739095473,
111+
"searchingStatus": "stop",
112+
"lastKnownConnection": {
113+
"updated": 1713422813,
114+
"connectedUser": {
115+
"id": "sk3oyvsbkm",
116+
"name": ""
117+
},
118+
"connectedDevice": {
119+
"id": "4f3faa4c-976c-3bd8-b209-607f3a5a9814",
120+
"name": ""
121+
},
122+
"d2dStatus": "bleScanned",
123+
"nearby": true,
124+
"onDemand": false
125+
},
126+
"e2eEncryption": {
127+
"enabled": false
128+
},
129+
"timer": 1713422675,
130+
"category": {
131+
"id": 0
132+
},
133+
"remoteRing": {
134+
"enabled": false
135+
},
136+
"petWalking": {
137+
"enabled": false
138+
},
139+
"onboardedBy": {
140+
"saGuid": "sk3oyvsbkm"
141+
},
142+
"shareable": {
143+
"enabled": false
144+
},
145+
"agingCounter": {
146+
"status": "VALID",
147+
"updated": 1713422675
148+
},
149+
"vendor": {
150+
"mnId": "0AFD",
151+
"setupId": "432",
152+
"modelName": "EI-T7300"
153+
},
154+
"priorityConnection": {
155+
"lba": false,
156+
"cameraShutter": false
157+
},
158+
"createTime": 1685007780,
159+
"updateTime": 1713422675,
160+
"fmmSearch": false,
161+
"ooTime": {
162+
"currentOoTime": 8,
163+
"defaultOoTime": 8
164+
},
165+
"pidPoolSize": {
166+
"desiredPidPoolSize": 2000,
167+
"currentPidPoolSize": 2000
168+
},
169+
"activeMode": {
170+
"mode": 0
171+
},
172+
"itemConfig": {
173+
"searchingStatus": "stop"
174+
}
175+
}
176+
},
177+
"type": "BLE_D2D",
178+
"restrictionTier": 0,
179+
"allowed": [],
180+
"executionContext": "CLOUD"
181+
}
182+
],
183+
"_links": {}
184+
}

tests/components/smartthings/snapshots/test_init.ambr

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,6 +1487,39 @@
14871487
'via_device_id': None,
14881488
})
14891489
# ---
1490+
# name: test_devices[im_smarttag2_ble_uwb]
1491+
DeviceRegistryEntrySnapshot({
1492+
'area_id': None,
1493+
'config_entries': <ANY>,
1494+
'config_entries_subentries': <ANY>,
1495+
'configuration_url': 'https://account.smartthings.com',
1496+
'connections': set({
1497+
}),
1498+
'disabled_by': None,
1499+
'entry_type': None,
1500+
'hw_version': None,
1501+
'id': <ANY>,
1502+
'identifiers': set({
1503+
tuple(
1504+
'smartthings',
1505+
'83d660e4-b0c8-4881-a674-d9f1730366c1',
1506+
),
1507+
}),
1508+
'is_new': False,
1509+
'labels': set({
1510+
}),
1511+
'manufacturer': None,
1512+
'model': None,
1513+
'model_id': None,
1514+
'name': 'SmartTag+ black',
1515+
'name_by_user': None,
1516+
'primary_config_entry': <ANY>,
1517+
'serial_number': None,
1518+
'suggested_area': None,
1519+
'sw_version': None,
1520+
'via_device_id': None,
1521+
})
1522+
# ---
14901523
# name: test_devices[im_speaker_ai_0001]
14911524
DeviceRegistryEntrySnapshot({
14921525
'area_id': None,

0 commit comments

Comments
 (0)