Use identify device class in Elgato identify button entity (#95361)

* Use identify device class in Elgato identify button entity

* Clean up strings
This commit is contained in:
Franck Nijhof 2023-06-27 19:59:49 +02:00 committed by GitHub
parent 0fc51ac75a
commit 48776f86dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 11 deletions

View File

@ -40,8 +40,7 @@ class ElgatoButtonEntityDescription(
BUTTONS = [ BUTTONS = [
ElgatoButtonEntityDescription( ElgatoButtonEntityDescription(
key="identify", key="identify",
translation_key="identify", device_class=ButtonDeviceClass.IDENTIFY,
icon="mdi:help",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
press_fn=lambda client: client.identify(), press_fn=lambda client: client.identify(),
), ),

View File

@ -23,11 +23,6 @@
} }
}, },
"entity": { "entity": {
"button": {
"identify": {
"name": "Identify"
}
},
"sensor": { "sensor": {
"charge_power": { "charge_power": {
"name": "Charging power" "name": "Charging power"

View File

@ -2,8 +2,8 @@
# name: test_buttons[button.frenck_identify-identify-key-light-mini] # name: test_buttons[button.frenck_identify-identify-key-light-mini]
StateSnapshot({ StateSnapshot({
'attributes': ReadOnlyDict({ 'attributes': ReadOnlyDict({
'device_class': 'identify',
'friendly_name': 'Frenck Identify', 'friendly_name': 'Frenck Identify',
'icon': 'mdi:help',
}), }),
'context': <ANY>, 'context': <ANY>,
'entity_id': 'button.frenck_identify', 'entity_id': 'button.frenck_identify',
@ -32,12 +32,12 @@
'name': None, 'name': None,
'options': dict({ 'options': dict({
}), }),
'original_device_class': None, 'original_device_class': <ButtonDeviceClass.IDENTIFY: 'identify'>,
'original_icon': 'mdi:help', 'original_icon': None,
'original_name': 'Identify', 'original_name': 'Identify',
'platform': 'elgato', 'platform': 'elgato',
'supported_features': 0, 'supported_features': 0,
'translation_key': 'identify', 'translation_key': None,
'unique_id': 'GW24L1A02987_identify', 'unique_id': 'GW24L1A02987_identify',
'unit_of_measurement': None, 'unit_of_measurement': None,
}) })