Add icon translations to Solarlog (#112232)

This commit is contained in:
Joost Lekkerkerker 2024-03-04 15:46:34 +01:00 committed by GitHub
parent 2db0da3915
commit 7089ace894
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 39 additions and 11 deletions

View File

@ -0,0 +1,39 @@
{
"entity": {
"sensor": {
"power_ac": {
"default": "mdi:solar-power"
},
"power_dc": {
"default": "mdi:solar-power"
},
"yield_day": {
"default": "mdi:solar-power"
},
"yield_yesterday": {
"default": "mdi:solar-power"
},
"yield_month": {
"default": "mdi:solar-power"
},
"yield_year": {
"default": "mdi:solar-power"
},
"yield_total": {
"default": "mdi:solar-power"
},
"total_power": {
"default": "mdi:solar-power"
},
"alternator_loss": {
"default": "mdi:solar-power"
},
"capacity": {
"default": "mdi:solar-power"
},
"power_available": {
"default": "mdi:solar-power"
}
}
}
}

View File

@ -43,7 +43,6 @@ SENSOR_TYPES: tuple[SolarLogSensorEntityDescription, ...] = (
SolarLogSensorEntityDescription(
key="power_ac",
translation_key="power_ac",
icon="mdi:solar-power",
native_unit_of_measurement=UnitOfPower.WATT,
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
@ -51,7 +50,6 @@ SENSOR_TYPES: tuple[SolarLogSensorEntityDescription, ...] = (
SolarLogSensorEntityDescription(
key="power_dc",
translation_key="power_dc",
icon="mdi:solar-power",
native_unit_of_measurement=UnitOfPower.WATT,
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
@ -73,7 +71,6 @@ SENSOR_TYPES: tuple[SolarLogSensorEntityDescription, ...] = (
SolarLogSensorEntityDescription(
key="yield_day",
translation_key="yield_day",
icon="mdi:solar-power",
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
value=lambda value: round(value / 1000, 3),
@ -81,7 +78,6 @@ SENSOR_TYPES: tuple[SolarLogSensorEntityDescription, ...] = (
SolarLogSensorEntityDescription(
key="yield_yesterday",
translation_key="yield_yesterday",
icon="mdi:solar-power",
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
value=lambda value: round(value / 1000, 3),
@ -89,7 +85,6 @@ SENSOR_TYPES: tuple[SolarLogSensorEntityDescription, ...] = (
SolarLogSensorEntityDescription(
key="yield_month",
translation_key="yield_month",
icon="mdi:solar-power",
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
value=lambda value: round(value / 1000, 3),
@ -97,7 +92,6 @@ SENSOR_TYPES: tuple[SolarLogSensorEntityDescription, ...] = (
SolarLogSensorEntityDescription(
key="yield_year",
translation_key="yield_year",
icon="mdi:solar-power",
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
value=lambda value: round(value / 1000, 3),
@ -105,7 +99,6 @@ SENSOR_TYPES: tuple[SolarLogSensorEntityDescription, ...] = (
SolarLogSensorEntityDescription(
key="yield_total",
translation_key="yield_total",
icon="mdi:solar-power",
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL,
@ -157,14 +150,12 @@ SENSOR_TYPES: tuple[SolarLogSensorEntityDescription, ...] = (
SolarLogSensorEntityDescription(
key="total_power",
translation_key="total_power",
icon="mdi:solar-power",
native_unit_of_measurement=UnitOfPower.WATT,
device_class=SensorDeviceClass.POWER,
),
SolarLogSensorEntityDescription(
key="alternator_loss",
translation_key="alternator_loss",
icon="mdi:solar-power",
native_unit_of_measurement=UnitOfPower.WATT,
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
@ -172,7 +163,6 @@ SENSOR_TYPES: tuple[SolarLogSensorEntityDescription, ...] = (
SolarLogSensorEntityDescription(
key="capacity",
translation_key="capacity",
icon="mdi:solar-power",
native_unit_of_measurement=PERCENTAGE,
device_class=SensorDeviceClass.POWER_FACTOR,
state_class=SensorStateClass.MEASUREMENT,
@ -189,7 +179,6 @@ SENSOR_TYPES: tuple[SolarLogSensorEntityDescription, ...] = (
SolarLogSensorEntityDescription(
key="power_available",
translation_key="power_available",
icon="mdi:solar-power",
native_unit_of_measurement=UnitOfPower.WATT,
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,