Add icon translations to Electric Kiwi (#111422)

This commit is contained in:
Joost Lekkerkerker 2024-02-25 23:00:22 +01:00 committed by GitHub
parent e366763eb2
commit 33cb54b888
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 4 deletions

View File

@ -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"
}
}
}
}

View File

@ -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(