diff --git a/homeassistant/components/elgato/button.py b/homeassistant/components/elgato/button.py index 0dd602f1ecd..97673a79b9a 100644 --- a/homeassistant/components/elgato/button.py +++ b/homeassistant/components/elgato/button.py @@ -40,14 +40,14 @@ class ElgatoButtonEntityDescription( BUTTONS = [ ElgatoButtonEntityDescription( key="identify", - name="Identify", + translation_key="identify", icon="mdi:help", entity_category=EntityCategory.CONFIG, press_fn=lambda client: client.identify(), ), ElgatoButtonEntityDescription( key="restart", - name="Restart", + translation_key="restart", device_class=ButtonDeviceClass.RESTART, entity_category=EntityCategory.CONFIG, press_fn=lambda client: client.restart(), diff --git a/homeassistant/components/elgato/sensor.py b/homeassistant/components/elgato/sensor.py index 2692cf10850..371840de013 100644 --- a/homeassistant/components/elgato/sensor.py +++ b/homeassistant/components/elgato/sensor.py @@ -45,7 +45,7 @@ class ElgatoSensorEntityDescription( SENSORS = [ ElgatoSensorEntityDescription( key="battery", - name="Battery", + translation_key="battery", device_class=SensorDeviceClass.BATTERY, entity_category=EntityCategory.DIAGNOSTIC, native_unit_of_measurement=PERCENTAGE, @@ -56,7 +56,7 @@ SENSORS = [ ), ElgatoSensorEntityDescription( key="voltage", - name="Battery voltage", + translation_key="voltage", entity_registry_enabled_default=False, device_class=SensorDeviceClass.VOLTAGE, entity_category=EntityCategory.DIAGNOSTIC, @@ -69,7 +69,7 @@ SENSORS = [ ), ElgatoSensorEntityDescription( key="input_charge_current", - name="Charging current", + translation_key="input_charge_current", entity_registry_enabled_default=False, device_class=SensorDeviceClass.CURRENT, entity_category=EntityCategory.DIAGNOSTIC, @@ -82,7 +82,7 @@ SENSORS = [ ), ElgatoSensorEntityDescription( key="charge_power", - name="Charging power", + translation_key="charge_power", entity_registry_enabled_default=False, device_class=SensorDeviceClass.POWER, entity_category=EntityCategory.DIAGNOSTIC, @@ -94,7 +94,7 @@ SENSORS = [ ), ElgatoSensorEntityDescription( key="input_charge_voltage", - name="Charging voltage", + translation_key="input_charge_voltage", entity_registry_enabled_default=False, device_class=SensorDeviceClass.VOLTAGE, entity_category=EntityCategory.DIAGNOSTIC, diff --git a/homeassistant/components/elgato/strings.json b/homeassistant/components/elgato/strings.json index fc0007ac301..c5fc016aeb9 100644 --- a/homeassistant/components/elgato/strings.json +++ b/homeassistant/components/elgato/strings.json @@ -21,5 +21,40 @@ "already_configured": "[%key:common::config_flow::abort::already_configured_device%]", "cannot_connect": "[%key:common::config_flow::error::cannot_connect%]" } + }, + "entity": { + "button": { + "identify": { + "name": "Identify" + }, + "restart": { + "name": "[%key:component::button::entity_component::restart::name%]" + } + }, + "sensor": { + "battery": { + "name": "[%key:component::sensor::entity_component::battery::name%]" + }, + "charge_power": { + "name": "Charging power" + }, + "input_charge_current": { + "name": "Charging current" + }, + "input_charge_voltage": { + "name": "Charging voltage" + }, + "voltage": { + "name": "Battery voltage" + } + }, + "switch": { + "bypass": { + "name": "Studio mode" + }, + "energy_saving": { + "name": "Energy saving" + } + } } } diff --git a/homeassistant/components/elgato/switch.py b/homeassistant/components/elgato/switch.py index 00159099718..78af3adfa53 100644 --- a/homeassistant/components/elgato/switch.py +++ b/homeassistant/components/elgato/switch.py @@ -39,7 +39,7 @@ class ElgatoSwitchEntityDescription( SWITCHES = [ ElgatoSwitchEntityDescription( key="bypass", - name="Studio mode", + translation_key="bypass", icon="mdi:battery-off-outline", entity_category=EntityCategory.CONFIG, has_fn=lambda x: x.battery is not None, @@ -48,7 +48,7 @@ SWITCHES = [ ), ElgatoSwitchEntityDescription( key="energy_saving", - name="Energy saving", + translation_key="energy_saving", icon="mdi:leaf", entity_category=EntityCategory.CONFIG, has_fn=lambda x: x.battery is not None, diff --git a/tests/components/elgato/snapshots/test_button.ambr b/tests/components/elgato/snapshots/test_button.ambr index 900a3f316f5..cb420c486b4 100644 --- a/tests/components/elgato/snapshots/test_button.ambr +++ b/tests/components/elgato/snapshots/test_button.ambr @@ -37,7 +37,7 @@ 'original_name': 'Identify', 'platform': 'elgato', 'supported_features': 0, - 'translation_key': None, + 'translation_key': 'identify', 'unique_id': 'GW24L1A02987_identify', 'unit_of_measurement': None, }) @@ -111,7 +111,7 @@ 'original_name': 'Restart', 'platform': 'elgato', 'supported_features': 0, - 'translation_key': None, + 'translation_key': 'restart', 'unique_id': 'GW24L1A02987_restart', 'unit_of_measurement': None, }) diff --git a/tests/components/elgato/snapshots/test_sensor.ambr b/tests/components/elgato/snapshots/test_sensor.ambr index fa22ca1dfab..35429b8a320 100644 --- a/tests/components/elgato/snapshots/test_sensor.ambr +++ b/tests/components/elgato/snapshots/test_sensor.ambr @@ -44,7 +44,7 @@ 'original_name': 'Battery', 'platform': 'elgato', 'supported_features': 0, - 'translation_key': None, + 'translation_key': 'battery', 'unique_id': 'GW24L1A02987_battery', 'unit_of_measurement': '%', }) @@ -128,7 +128,7 @@ 'original_name': 'Battery voltage', 'platform': 'elgato', 'supported_features': 0, - 'translation_key': None, + 'translation_key': 'voltage', 'unique_id': 'GW24L1A02987_voltage', 'unit_of_measurement': , }) @@ -212,7 +212,7 @@ 'original_name': 'Charging current', 'platform': 'elgato', 'supported_features': 0, - 'translation_key': None, + 'translation_key': 'input_charge_current', 'unique_id': 'GW24L1A02987_input_charge_current', 'unit_of_measurement': , }) @@ -293,7 +293,7 @@ 'original_name': 'Charging power', 'platform': 'elgato', 'supported_features': 0, - 'translation_key': None, + 'translation_key': 'charge_power', 'unique_id': 'GW24L1A02987_charge_power', 'unit_of_measurement': , }) @@ -377,7 +377,7 @@ 'original_name': 'Charging voltage', 'platform': 'elgato', 'supported_features': 0, - 'translation_key': None, + 'translation_key': 'input_charge_voltage', 'unique_id': 'GW24L1A02987_input_charge_voltage', 'unit_of_measurement': , }) diff --git a/tests/components/elgato/snapshots/test_switch.ambr b/tests/components/elgato/snapshots/test_switch.ambr index 02f32d22f96..dcba00c0a9e 100644 --- a/tests/components/elgato/snapshots/test_switch.ambr +++ b/tests/components/elgato/snapshots/test_switch.ambr @@ -37,7 +37,7 @@ 'original_name': 'Energy saving', 'platform': 'elgato', 'supported_features': 0, - 'translation_key': None, + 'translation_key': 'energy_saving', 'unique_id': 'GW24L1A02987_energy_saving', 'unit_of_measurement': None, }) @@ -111,7 +111,7 @@ 'original_name': 'Studio mode', 'platform': 'elgato', 'supported_features': 0, - 'translation_key': None, + 'translation_key': 'bypass', 'unique_id': 'GW24L1A02987_bypass', 'unit_of_measurement': None, })