From 807765400270a88c17c45308dd9b86b56127189b Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Sat, 2 Mar 2024 01:01:46 +0100 Subject: [PATCH] Add icon translations to ovo energy (#111997) --- homeassistant/components/ovo_energy/icons.json | 12 ++++++++++++ homeassistant/components/ovo_energy/sensor.py | 2 -- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 homeassistant/components/ovo_energy/icons.json diff --git a/homeassistant/components/ovo_energy/icons.json b/homeassistant/components/ovo_energy/icons.json new file mode 100644 index 00000000000..083e8ca8c2c --- /dev/null +++ b/homeassistant/components/ovo_energy/icons.json @@ -0,0 +1,12 @@ +{ + "entity": { + "sensor": { + "last_gas_reading": { + "default": "mdi:gas-cylinder" + }, + "last_gas_cost": { + "default": "mdi:cash-multiple" + } + } + } +} diff --git a/homeassistant/components/ovo_energy/sensor.py b/homeassistant/components/ovo_energy/sensor.py index 761515c9c84..059ced8477e 100644 --- a/homeassistant/components/ovo_energy/sensor.py +++ b/homeassistant/components/ovo_energy/sensor.py @@ -81,7 +81,6 @@ SENSOR_TYPES_GAS: tuple[OVOEnergySensorEntityDescription, ...] = ( device_class=SensorDeviceClass.ENERGY, state_class=SensorStateClass.TOTAL_INCREASING, native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, - icon="mdi:gas-cylinder", value=lambda usage: usage.gas[-1].consumption, ), OVOEnergySensorEntityDescription( @@ -89,7 +88,6 @@ SENSOR_TYPES_GAS: tuple[OVOEnergySensorEntityDescription, ...] = ( translation_key=KEY_LAST_GAS_COST, device_class=SensorDeviceClass.MONETARY, state_class=SensorStateClass.TOTAL_INCREASING, - icon="mdi:cash-multiple", value=lambda usage: usage.gas[-1].cost.amount if usage.gas[-1].cost is not None else None,