From 48776f86dc2584c4fb5d339f53c1c1afc92ee4da Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Tue, 27 Jun 2023 19:59:49 +0200 Subject: [PATCH] Use identify device class in Elgato identify button entity (#95361) * Use identify device class in Elgato identify button entity * Clean up strings --- homeassistant/components/elgato/button.py | 3 +-- homeassistant/components/elgato/strings.json | 5 ----- tests/components/elgato/snapshots/test_button.ambr | 8 ++++---- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/homeassistant/components/elgato/button.py b/homeassistant/components/elgato/button.py index 48a3d7d8b4a..b05cd532c16 100644 --- a/homeassistant/components/elgato/button.py +++ b/homeassistant/components/elgato/button.py @@ -40,8 +40,7 @@ class ElgatoButtonEntityDescription( BUTTONS = [ ElgatoButtonEntityDescription( key="identify", - translation_key="identify", - icon="mdi:help", + device_class=ButtonDeviceClass.IDENTIFY, entity_category=EntityCategory.CONFIG, press_fn=lambda client: client.identify(), ), diff --git a/homeassistant/components/elgato/strings.json b/homeassistant/components/elgato/strings.json index bef7b4ddcbf..8a2f20f209f 100644 --- a/homeassistant/components/elgato/strings.json +++ b/homeassistant/components/elgato/strings.json @@ -23,11 +23,6 @@ } }, "entity": { - "button": { - "identify": { - "name": "Identify" - } - }, "sensor": { "charge_power": { "name": "Charging power" diff --git a/tests/components/elgato/snapshots/test_button.ambr b/tests/components/elgato/snapshots/test_button.ambr index 7aaa8f2383a..920aa40bfe7 100644 --- a/tests/components/elgato/snapshots/test_button.ambr +++ b/tests/components/elgato/snapshots/test_button.ambr @@ -2,8 +2,8 @@ # name: test_buttons[button.frenck_identify-identify-key-light-mini] StateSnapshot({ 'attributes': ReadOnlyDict({ + 'device_class': 'identify', 'friendly_name': 'Frenck Identify', - 'icon': 'mdi:help', }), 'context': , 'entity_id': 'button.frenck_identify', @@ -32,12 +32,12 @@ 'name': None, 'options': dict({ }), - 'original_device_class': None, - 'original_icon': 'mdi:help', + 'original_device_class': , + 'original_icon': None, 'original_name': 'Identify', 'platform': 'elgato', 'supported_features': 0, - 'translation_key': 'identify', + 'translation_key': None, 'unique_id': 'GW24L1A02987_identify', 'unit_of_measurement': None, })