From c225c46853e66fb25910d9caf5e7061156586d3c Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Tue, 27 Jun 2023 12:31:57 +0200 Subject: [PATCH] Clean up device class based entity translations in Community.Sensors (#95011) --- homeassistant/components/luftdaten/sensor.py | 5 ----- homeassistant/components/luftdaten/strings.json | 17 +---------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/homeassistant/components/luftdaten/sensor.py b/homeassistant/components/luftdaten/sensor.py index 262a6701f56..cca467ce756 100644 --- a/homeassistant/components/luftdaten/sensor.py +++ b/homeassistant/components/luftdaten/sensor.py @@ -32,21 +32,18 @@ from .const import ATTR_SENSOR_ID, CONF_SENSOR_ID, DOMAIN SENSORS: tuple[SensorEntityDescription, ...] = ( SensorEntityDescription( key="temperature", - translation_key="temperature", native_unit_of_measurement=UnitOfTemperature.CELSIUS, device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, ), SensorEntityDescription( key="humidity", - translation_key="humidity", native_unit_of_measurement=PERCENTAGE, device_class=SensorDeviceClass.HUMIDITY, state_class=SensorStateClass.MEASUREMENT, ), SensorEntityDescription( key="pressure", - translation_key="pressure", native_unit_of_measurement=UnitOfPressure.PA, device_class=SensorDeviceClass.PRESSURE, state_class=SensorStateClass.MEASUREMENT, @@ -60,14 +57,12 @@ SENSORS: tuple[SensorEntityDescription, ...] = ( ), SensorEntityDescription( key="P1", - translation_key="pm10", native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, device_class=SensorDeviceClass.PM10, state_class=SensorStateClass.MEASUREMENT, ), SensorEntityDescription( key="P2", - translation_key="pm25", native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, device_class=SensorDeviceClass.PM25, state_class=SensorStateClass.MEASUREMENT, diff --git a/homeassistant/components/luftdaten/strings.json b/homeassistant/components/luftdaten/strings.json index d54bc6d0bdc..e990142923f 100644 --- a/homeassistant/components/luftdaten/strings.json +++ b/homeassistant/components/luftdaten/strings.json @@ -16,22 +16,7 @@ }, "entity": { "sensor": { - "humidity": { - "name": "[%key:component::sensor::entity_component::humidity::name%]" - }, - "pressure": { - "name": "[%key:component::sensor::entity_component::pressure::name%]" - }, - "pressure_at_sealevel": { "name": "Pressure at sealevel" }, - "pm10": { - "name": "[%key:component::sensor::entity_component::pm10::name%]" - }, - "pm25": { - "name": "[%key:component::sensor::entity_component::pm25::name%]" - }, - "temperature": { - "name": "[%key:component::sensor::entity_component::temperature::name%]" - } + "pressure_at_sealevel": { "name": "Pressure at sealevel" } } } }