Add icon translations to amberelectric (#111321)

pull/111379/head
Joost Lekkerkerker 2024-02-25 10:37:29 +01:00 committed by GitHub
parent a706d5e282
commit dbc4d90435
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 22 additions and 10 deletions

View File

@ -0,0 +1,18 @@
{
"entity": {
"sensor": {
"general": {
"default": "mdi:transmission-tower"
},
"controlled_load": {
"default": "mdi:clock-outline"
},
"feed_in": {
"default": "mdi:solar-power"
},
"renewables": {
"default": "mdi:solar-power"
}
}
}
}

View File

@ -27,12 +27,6 @@ from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import ATTRIBUTION, DOMAIN
from .coordinator import AmberUpdateCoordinator, normalize_descriptor
ICONS = {
"general": "mdi:transmission-tower",
"controlled_load": "mdi:clock-outline",
"feed_in": "mdi:solar-power",
}
UNIT = f"{CURRENCY_DOLLAR}/{UnitOfEnergy.KILO_WATT_HOUR}"
@ -219,7 +213,7 @@ async def async_setup_entry(
name=f"{entry.title} - {friendly_channel_type(channel_type)} Price",
native_unit_of_measurement=UNIT,
state_class=SensorStateClass.MEASUREMENT,
icon=ICONS[channel_type],
translation_key=channel_type,
)
entities.append(AmberPriceSensor(coordinator, description, channel_type))
@ -230,7 +224,7 @@ async def async_setup_entry(
f"{entry.title} - {friendly_channel_type(channel_type)} Price"
" Descriptor"
),
icon=ICONS[channel_type],
translation_key=channel_type,
)
entities.append(
AmberPriceDescriptorSensor(coordinator, description, channel_type)
@ -242,7 +236,7 @@ async def async_setup_entry(
name=f"{entry.title} - {friendly_channel_type(channel_type)} Forecast",
native_unit_of_measurement=UNIT,
state_class=SensorStateClass.MEASUREMENT,
icon=ICONS[channel_type],
translation_key=channel_type,
)
entities.append(AmberForecastSensor(coordinator, description, channel_type))
@ -251,7 +245,7 @@ async def async_setup_entry(
name=f"{entry.title} - Renewables",
native_unit_of_measurement=PERCENTAGE,
state_class=SensorStateClass.MEASUREMENT,
icon="mdi:solar-power",
translation_key="renewables",
)
entities.append(AmberGridSensor(coordinator, renewables_description))