Skip to content

Commit 06382f3

Browse files
authored
Add command to SmartThings button unique id (#141281)
* Add command to SmartThings button unique id * Add command to SmartThings button unique id
1 parent b3e3d77 commit 06382f3

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

homeassistant/components/smartthings/button.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@ def __init__(
6363
"""Initialize the instance."""
6464
super().__init__(client, device, set())
6565
self.entity_description = entity_description
66-
self._attr_unique_id = (
67-
f"{device.device.device_id}_{MAIN}_{entity_description.key}"
68-
)
66+
self._attr_unique_id = f"{device.device.device_id}_{MAIN}_{entity_description.key}_{entity_description.command}"
6967

7068
async def async_press(self) -> None:
7169
"""Press the button."""

tests/components/smartthings/snapshots/test_button.ambr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
'previous_unique_id': None,
3030
'supported_features': 0,
3131
'translation_key': 'stop',
32-
'unique_id': '2bad3237-4886-e699-1b90-4a51a3d55c8a_main_ovenOperatingState',
32+
'unique_id': '2bad3237-4886-e699-1b90-4a51a3d55c8a_main_ovenOperatingState_stop',
3333
'unit_of_measurement': None,
3434
})
3535
# ---
@@ -76,7 +76,7 @@
7676
'previous_unique_id': None,
7777
'supported_features': 0,
7878
'translation_key': 'stop',
79-
'unique_id': '9447959a-0dfa-6b27-d40d-650da525c53f_main_ovenOperatingState',
79+
'unique_id': '9447959a-0dfa-6b27-d40d-650da525c53f_main_ovenOperatingState_stop',
8080
'unit_of_measurement': None,
8181
})
8282
# ---
@@ -123,7 +123,7 @@
123123
'previous_unique_id': None,
124124
'supported_features': 0,
125125
'translation_key': 'stop',
126-
'unique_id': '2c3cbaa0-1899-5ddc-7b58-9d657bd48f18_main_ovenOperatingState',
126+
'unique_id': '2c3cbaa0-1899-5ddc-7b58-9d657bd48f18_main_ovenOperatingState_stop',
127127
'unit_of_measurement': None,
128128
})
129129
# ---

0 commit comments

Comments
 (0)