From 18e1b3bbbccda2b6b071a113601235683382028c Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Fri, 1 Mar 2024 12:21:31 +0100 Subject: [PATCH] Add icon translations to Enocean (#111514) --- homeassistant/components/enocean/icons.json | 9 +++++++++ homeassistant/components/enocean/sensor.py | 5 +---- 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 homeassistant/components/enocean/icons.json diff --git a/homeassistant/components/enocean/icons.json b/homeassistant/components/enocean/icons.json new file mode 100644 index 00000000000..81cd49ac670 --- /dev/null +++ b/homeassistant/components/enocean/icons.json @@ -0,0 +1,9 @@ +{ + "entity": { + "sensor": { + "window_handle": { + "default": "mdi:window-open-variant" + } + } + } +} diff --git a/homeassistant/components/enocean/sensor.py b/homeassistant/components/enocean/sensor.py index 83c801d598e..e4dd9c7cfb1 100644 --- a/homeassistant/components/enocean/sensor.py +++ b/homeassistant/components/enocean/sensor.py @@ -62,7 +62,6 @@ SENSOR_DESC_TEMPERATURE = EnOceanSensorEntityDescription( key=SENSOR_TYPE_TEMPERATURE, name="Temperature", native_unit_of_measurement=UnitOfTemperature.CELSIUS, - icon="mdi:thermometer", device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, unique_id=lambda dev_id: f"{combine_hex(dev_id)}-{SENSOR_TYPE_TEMPERATURE}", @@ -72,7 +71,6 @@ SENSOR_DESC_HUMIDITY = EnOceanSensorEntityDescription( key=SENSOR_TYPE_HUMIDITY, name="Humidity", native_unit_of_measurement=PERCENTAGE, - icon="mdi:water-percent", device_class=SensorDeviceClass.HUMIDITY, state_class=SensorStateClass.MEASUREMENT, unique_id=lambda dev_id: f"{combine_hex(dev_id)}-{SENSOR_TYPE_HUMIDITY}", @@ -82,7 +80,6 @@ SENSOR_DESC_POWER = EnOceanSensorEntityDescription( key=SENSOR_TYPE_POWER, name="Power", native_unit_of_measurement=UnitOfPower.WATT, - icon="mdi:power-plug", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, unique_id=lambda dev_id: f"{combine_hex(dev_id)}-{SENSOR_TYPE_POWER}", @@ -91,7 +88,7 @@ SENSOR_DESC_POWER = EnOceanSensorEntityDescription( SENSOR_DESC_WINDOWHANDLE = EnOceanSensorEntityDescription( key=SENSOR_TYPE_WINDOWHANDLE, name="WindowHandle", - icon="mdi:window-open-variant", + translation_key="window_handle", unique_id=lambda dev_id: f"{combine_hex(dev_id)}-{SENSOR_TYPE_WINDOWHANDLE}", )