From 33cb54b888f222c4aba4ba4af7ccf40bf0c8e4f8 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Sun, 25 Feb 2024 23:00:22 +0100 Subject: [PATCH] Add icon translations to Electric Kiwi (#111422) --- .../components/electric_kiwi/icons.json | 18 ++++++++++++++++++ .../components/electric_kiwi/sensor.py | 4 ---- 2 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 homeassistant/components/electric_kiwi/icons.json diff --git a/homeassistant/components/electric_kiwi/icons.json b/homeassistant/components/electric_kiwi/icons.json new file mode 100644 index 00000000000..1932ce19432 --- /dev/null +++ b/homeassistant/components/electric_kiwi/icons.json @@ -0,0 +1,18 @@ +{ + "entity": { + "sensor": { + "total_running_balance": { + "default": "mdi:currency-usd" + }, + "total_current_balance": { + "default": "mdi:currency-usd" + }, + "next_billing_date": { + "default": "mdi:calendar" + }, + "hop_power_savings": { + "default": "mdi:percent" + } + } + } +} diff --git a/homeassistant/components/electric_kiwi/sensor.py b/homeassistant/components/electric_kiwi/sensor.py index 4f8cc59757d..83431dfd925 100644 --- a/homeassistant/components/electric_kiwi/sensor.py +++ b/homeassistant/components/electric_kiwi/sensor.py @@ -52,7 +52,6 @@ ACCOUNT_SENSOR_TYPES: tuple[ElectricKiwiAccountSensorEntityDescription, ...] = ( ElectricKiwiAccountSensorEntityDescription( key=ATTR_TOTAL_RUNNING_BALANCE, translation_key="total_running_balance", - icon="mdi:currency-usd", device_class=SensorDeviceClass.MONETARY, state_class=SensorStateClass.TOTAL, native_unit_of_measurement=CURRENCY_DOLLAR, @@ -61,7 +60,6 @@ ACCOUNT_SENSOR_TYPES: tuple[ElectricKiwiAccountSensorEntityDescription, ...] = ( ElectricKiwiAccountSensorEntityDescription( key=ATTR_TOTAL_CURRENT_BALANCE, translation_key="total_current_balance", - icon="mdi:currency-usd", device_class=SensorDeviceClass.MONETARY, state_class=SensorStateClass.TOTAL, native_unit_of_measurement=CURRENCY_DOLLAR, @@ -70,7 +68,6 @@ ACCOUNT_SENSOR_TYPES: tuple[ElectricKiwiAccountSensorEntityDescription, ...] = ( ElectricKiwiAccountSensorEntityDescription( key=ATTR_NEXT_BILLING_DATE, translation_key="next_billing_date", - icon="mdi:calendar", device_class=SensorDeviceClass.DATE, value_func=lambda account_balance: datetime.strptime( account_balance.next_billing_date, "%Y-%m-%d" @@ -79,7 +76,6 @@ ACCOUNT_SENSOR_TYPES: tuple[ElectricKiwiAccountSensorEntityDescription, ...] = ( ElectricKiwiAccountSensorEntityDescription( key=ATTR_HOP_PERCENTAGE, translation_key="hop_power_savings", - icon="mdi:percent", native_unit_of_measurement=PERCENTAGE, state_class=SensorStateClass.MEASUREMENT, value_func=lambda account_balance: float(