From c1e8eb7c964497d10db9da15ef682caf9eb89ea1 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Tue, 27 Jun 2023 14:06:57 +0200 Subject: [PATCH] Use device class translations for Fritzbox (#95363) --- homeassistant/components/fritzbox/sensor.py | 7 ------ .../components/fritzbox/strings.json | 23 +------------------ 2 files changed, 1 insertion(+), 29 deletions(-) diff --git a/homeassistant/components/fritzbox/sensor.py b/homeassistant/components/fritzbox/sensor.py index 498176d6c25..46fa1a26561 100644 --- a/homeassistant/components/fritzbox/sensor.py +++ b/homeassistant/components/fritzbox/sensor.py @@ -91,7 +91,6 @@ def value_scheduled_preset(device: FritzhomeDevice) -> str: SENSOR_TYPES: Final[tuple[FritzSensorEntityDescription, ...]] = ( FritzSensorEntityDescription( key="temperature", - translation_key="temperature", native_unit_of_measurement=UnitOfTemperature.CELSIUS, device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, @@ -101,7 +100,6 @@ SENSOR_TYPES: Final[tuple[FritzSensorEntityDescription, ...]] = ( ), FritzSensorEntityDescription( key="humidity", - translation_key="humidity", native_unit_of_measurement=PERCENTAGE, device_class=SensorDeviceClass.HUMIDITY, state_class=SensorStateClass.MEASUREMENT, @@ -110,7 +108,6 @@ SENSOR_TYPES: Final[tuple[FritzSensorEntityDescription, ...]] = ( ), FritzSensorEntityDescription( key="battery", - translation_key="battery", native_unit_of_measurement=PERCENTAGE, device_class=SensorDeviceClass.BATTERY, entity_category=EntityCategory.DIAGNOSTIC, @@ -119,7 +116,6 @@ SENSOR_TYPES: Final[tuple[FritzSensorEntityDescription, ...]] = ( ), FritzSensorEntityDescription( key="power_consumption", - translation_key="power_consumption", native_unit_of_measurement=UnitOfPower.WATT, device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -128,7 +124,6 @@ SENSOR_TYPES: Final[tuple[FritzSensorEntityDescription, ...]] = ( ), FritzSensorEntityDescription( key="voltage", - translation_key="voltage", native_unit_of_measurement=UnitOfElectricPotential.VOLT, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, @@ -137,7 +132,6 @@ SENSOR_TYPES: Final[tuple[FritzSensorEntityDescription, ...]] = ( ), FritzSensorEntityDescription( key="electric_current", - translation_key="electric_current", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, @@ -146,7 +140,6 @@ SENSOR_TYPES: Final[tuple[FritzSensorEntityDescription, ...]] = ( ), FritzSensorEntityDescription( key="total_energy", - translation_key="total_energy", native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, device_class=SensorDeviceClass.ENERGY, state_class=SensorStateClass.TOTAL_INCREASING, diff --git a/homeassistant/components/fritzbox/strings.json b/homeassistant/components/fritzbox/strings.json index 0b4becd6ff7..d5607aa3090 100644 --- a/homeassistant/components/fritzbox/strings.json +++ b/homeassistant/components/fritzbox/strings.json @@ -44,33 +44,12 @@ "lock": { "name": "Button lock on device" } }, "sensor": { - "battery": { - "name": "[%key:component::sensor::entity_component::battery::name%]" - }, "comfort_temperature": { "name": "Comfort temperature" }, "eco_temperature": { "name": "Eco temperature" }, - "electric_current": { - "name": "[%key:component::sensor::entity_component::current::name%]" - }, - "humidity": { - "name": "[%key:component::sensor::entity_component::humidity::name%]" - }, "nextchange_preset": { "name": "Next scheduled preset" }, "nextchange_temperature": { "name": "Next scheduled temperature" }, "nextchange_time": { "name": "Next scheduled change time" }, - "power_consumption": { - "name": "[%key:component::sensor::entity_component::power::name%]" - }, - "scheduled_preset": { "name": "Current scheduled preset" }, - "temperature": { - "name": "[%key:component::sensor::entity_component::temperature::name%]" - }, - "total_energy": { - "name": "[%key:component::sensor::entity_component::energy::name%]" - }, - "voltage": { - "name": "[%key:component::sensor::entity_component::voltage::name%]" - } + "scheduled_preset": { "name": "Current scheduled preset" } } } }