From 4fcc446255d682e6121073b5c4f50f85c7da973c Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Tue, 5 Mar 2024 15:03:22 +0100 Subject: [PATCH] Add icon translations to Watttime (#112351) --- homeassistant/components/watttime/icons.json | 12 ++++++++++++ homeassistant/components/watttime/sensor.py | 2 -- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 homeassistant/components/watttime/icons.json diff --git a/homeassistant/components/watttime/icons.json b/homeassistant/components/watttime/icons.json new file mode 100644 index 00000000000..e4c9cfa4f5b --- /dev/null +++ b/homeassistant/components/watttime/icons.json @@ -0,0 +1,12 @@ +{ + "entity": { + "sensor": { + "marginal_operating_emissions_rate": { + "default": "mdi:blur" + }, + "relative_marginal_emissions_intensity": { + "default": "mdi:blur" + } + } + } +} diff --git a/homeassistant/components/watttime/sensor.py b/homeassistant/components/watttime/sensor.py index ca5b0d06fa2..93560cef808 100644 --- a/homeassistant/components/watttime/sensor.py +++ b/homeassistant/components/watttime/sensor.py @@ -38,14 +38,12 @@ REALTIME_EMISSIONS_SENSOR_DESCRIPTIONS = ( SensorEntityDescription( key=SENSOR_TYPE_REALTIME_EMISSIONS_MOER, translation_key="marginal_operating_emissions_rate", - icon="mdi:blur", native_unit_of_measurement=f"{UnitOfMass.POUNDS} CO2/MWh", state_class=SensorStateClass.MEASUREMENT, ), SensorEntityDescription( key=SENSOR_TYPE_REALTIME_EMISSIONS_PERCENT, translation_key="relative_marginal_emissions_intensity", - icon="mdi:blur", native_unit_of_measurement=PERCENTAGE, state_class=SensorStateClass.MEASUREMENT, ),