From fe6402ef7357348aac5d8108a3180e682ce0a204 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Tue, 11 Jul 2023 20:19:04 +0200 Subject: [PATCH] Use device class naming for sfr box (#96092) --- homeassistant/components/sfr_box/button.py | 1 - homeassistant/components/sfr_box/sensor.py | 2 -- homeassistant/components/sfr_box/strings.json | 11 ----------- tests/components/sfr_box/snapshots/test_button.ambr | 2 +- tests/components/sfr_box/snapshots/test_sensor.ambr | 4 ++-- 5 files changed, 3 insertions(+), 17 deletions(-) diff --git a/homeassistant/components/sfr_box/button.py b/homeassistant/components/sfr_box/button.py index ab987944acc..13a1563034f 100644 --- a/homeassistant/components/sfr_box/button.py +++ b/homeassistant/components/sfr_box/button.py @@ -67,7 +67,6 @@ BUTTON_TYPES: tuple[SFRBoxButtonEntityDescription, ...] = ( device_class=ButtonDeviceClass.RESTART, entity_category=EntityCategory.CONFIG, key="system_reboot", - translation_key="reboot", ), ) diff --git a/homeassistant/components/sfr_box/sensor.py b/homeassistant/components/sfr_box/sensor.py index fa754bbe62f..c01d298daff 100644 --- a/homeassistant/components/sfr_box/sensor.py +++ b/homeassistant/components/sfr_box/sensor.py @@ -180,7 +180,6 @@ SYSTEM_SENSOR_TYPES: tuple[SFRBoxSensorEntityDescription[SystemInfo], ...] = ( entity_category=EntityCategory.DIAGNOSTIC, entity_registry_enabled_default=False, native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, - translation_key="voltage", value_fn=lambda x: x.alimvoltage, ), SFRBoxSensorEntityDescription[SystemInfo]( @@ -189,7 +188,6 @@ SYSTEM_SENSOR_TYPES: tuple[SFRBoxSensorEntityDescription[SystemInfo], ...] = ( entity_category=EntityCategory.DIAGNOSTIC, entity_registry_enabled_default=False, native_unit_of_measurement=UnitOfTemperature.CELSIUS, - translation_key="temperature", value_fn=lambda x: x.temperature / 1000, ), ) diff --git a/homeassistant/components/sfr_box/strings.json b/homeassistant/components/sfr_box/strings.json index cf74e9eb656..3fc9691cc12 100644 --- a/homeassistant/components/sfr_box/strings.json +++ b/homeassistant/components/sfr_box/strings.json @@ -42,11 +42,6 @@ "name": "WAN status" } }, - "button": { - "reboot": { - "name": "[%key:component::button::entity_component::restart::name%]" - } - }, "sensor": { "dsl_attenuation_down": { "name": "DSL attenuation down" @@ -110,12 +105,6 @@ "unknown": "Unknown" } }, - "temperature": { - "name": "[%key:component::sensor::entity_component::temperature::name%]" - }, - "voltage": { - "name": "[%key:component::sensor::entity_component::voltage::name%]" - }, "wan_mode": { "name": "WAN mode", "state": { diff --git a/tests/components/sfr_box/snapshots/test_button.ambr b/tests/components/sfr_box/snapshots/test_button.ambr index dc6ccc1f25d..f362cfc146f 100644 --- a/tests/components/sfr_box/snapshots/test_button.ambr +++ b/tests/components/sfr_box/snapshots/test_button.ambr @@ -54,7 +54,7 @@ 'original_name': 'Restart', 'platform': 'sfr_box', 'supported_features': 0, - 'translation_key': 'reboot', + 'translation_key': None, 'unique_id': 'e4:5d:51:00:11:22_system_reboot', 'unit_of_measurement': None, }), diff --git a/tests/components/sfr_box/snapshots/test_sensor.ambr b/tests/components/sfr_box/snapshots/test_sensor.ambr index 2390ba625eb..171a5803ada 100644 --- a/tests/components/sfr_box/snapshots/test_sensor.ambr +++ b/tests/components/sfr_box/snapshots/test_sensor.ambr @@ -89,7 +89,7 @@ 'original_name': 'Voltage', 'platform': 'sfr_box', 'supported_features': 0, - 'translation_key': 'voltage', + 'translation_key': None, 'unique_id': 'e4:5d:51:00:11:22_system_alimvoltage', 'unit_of_measurement': , }), @@ -117,7 +117,7 @@ 'original_name': 'Temperature', 'platform': 'sfr_box', 'supported_features': 0, - 'translation_key': 'temperature', + 'translation_key': None, 'unique_id': 'e4:5d:51:00:11:22_system_temperature', 'unit_of_measurement': , }),