Add command to SmartThings button unique id (#141281)

* Add command to SmartThings button unique id

* Add command to SmartThings button unique id
This commit is contained in:
Joost Lekkerkerker 2025-03-24 15:42:26 +01:00 committed by GitHub
parent b3e3d77d7c
commit 06382f33e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 6 deletions

View File

@ -63,9 +63,7 @@ class SmartThingsButtonEntity(SmartThingsEntity, ButtonEntity):
"""Initialize the instance."""
super().__init__(client, device, set())
self.entity_description = entity_description
self._attr_unique_id = (
f"{device.device.device_id}_{MAIN}_{entity_description.key}"
)
self._attr_unique_id = f"{device.device.device_id}_{MAIN}_{entity_description.key}_{entity_description.command}"
async def async_press(self) -> None:
"""Press the button."""

View File

@ -29,7 +29,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'stop',
'unique_id': '2bad3237-4886-e699-1b90-4a51a3d55c8a_main_ovenOperatingState',
'unique_id': '2bad3237-4886-e699-1b90-4a51a3d55c8a_main_ovenOperatingState_stop',
'unit_of_measurement': None,
})
# ---
@ -76,7 +76,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'stop',
'unique_id': '9447959a-0dfa-6b27-d40d-650da525c53f_main_ovenOperatingState',
'unique_id': '9447959a-0dfa-6b27-d40d-650da525c53f_main_ovenOperatingState_stop',
'unit_of_measurement': None,
})
# ---
@ -123,7 +123,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'stop',
'unique_id': '2c3cbaa0-1899-5ddc-7b58-9d657bd48f18_main_ovenOperatingState',
'unique_id': '2c3cbaa0-1899-5ddc-7b58-9d657bd48f18_main_ovenOperatingState_stop',
'unit_of_measurement': None,
})
# ---