Add icon translations to Anova (#108399)

This commit is contained in:
Joost Lekkerkerker 2024-01-19 20:05:56 +01:00 committed by GitHub
parent 4e11001a08
commit 86f34f8216
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 30 additions and 8 deletions

View File

@ -0,0 +1,24 @@
{
"entity": {
"sensor": {
"cook_time": {
"default": "mdi:clock-outline"
},
"target_temperature": {
"default": "mdi:thermometer"
},
"cook_time_remaining": {
"default": "mdi:clock-outline"
},
"heater_temperature": {
"default": "mdi:thermometer"
},
"triac_temperature": {
"default": "mdi:thermometer"
},
"water_temperature": {
"default": "mdi:thermometer"
}
}
}
}

View File

@ -42,30 +42,31 @@ SENSOR_DESCRIPTIONS: list[SensorEntityDescription] = [
key="cook_time",
state_class=SensorStateClass.TOTAL_INCREASING,
native_unit_of_measurement=UnitOfTime.SECONDS,
icon="mdi:clock-outline",
translation_key="cook_time",
device_class=SensorDeviceClass.DURATION,
value_fn=lambda data: data.cook_time,
),
AnovaSensorEntityDescription(
key="state", translation_key="state", value_fn=lambda data: data.state
key="state",
translation_key="state",
value_fn=lambda data: data.state,
),
AnovaSensorEntityDescription(
key="mode", translation_key="mode", value_fn=lambda data: data.mode
key="mode",
translation_key="mode",
value_fn=lambda data: data.mode,
),
AnovaSensorEntityDescription(
key="target_temperature",
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
icon="mdi:thermometer",
translation_key="target_temperature",
value_fn=lambda data: data.target_temperature,
),
AnovaSensorEntityDescription(
key="cook_time_remaining",
native_unit_of_measurement=UnitOfTime.SECONDS,
icon="mdi:clock-outline",
translation_key="cook_time_remaining",
device_class=SensorDeviceClass.DURATION,
value_fn=lambda data: data.cook_time_remaining,
@ -75,7 +76,6 @@ SENSOR_DESCRIPTIONS: list[SensorEntityDescription] = [
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
icon="mdi:thermometer",
translation_key="heater_temperature",
value_fn=lambda data: data.heater_temperature,
),
@ -84,7 +84,6 @@ SENSOR_DESCRIPTIONS: list[SensorEntityDescription] = [
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
icon="mdi:thermometer",
translation_key="triac_temperature",
value_fn=lambda data: data.triac_temperature,
),
@ -93,7 +92,6 @@ SENSOR_DESCRIPTIONS: list[SensorEntityDescription] = [
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
icon="mdi:thermometer",
translation_key="water_temperature",
value_fn=lambda data: data.water_temperature,
),