I’m using climate.py defined some custom fan_modes, my codes in fan_modes is
FAN_SILENT = "silent"
FAN_FULL_SPEED = "full"
self._attr_fan_modes = list(self._fan_speeds.keys())
@property
def fan_mode(self) -> str:
"""AC Climate fan mode."""
fan_speed = cast("int", self._device.get_attribute(ACAttributes.fan_speed))
if fan_speed > FanSpeed.AUTO:
return str(FAN_AUTO)
if fan_speed > FanSpeed.FULL_SPEED:
return str(FAN_FULL_SPEED)
if fan_speed > FanSpeed.HIGH:
return str(FAN_HIGH)
if fan_speed > FanSpeed.MEDIUM:
return str(FAN_MEDIUM)
if fan_speed > FanSpeed.LOW:
return str(FAN_LOW)
return str(FAN_SILENT)
add the translate files, for exmaple custom_components/midea_ac_lan/translations/en.json
{
"state": {
"climate": {
"fan_mode": {
"silent": "Silent",
"full": "Full"
}
}
},
"component": {
"midea_ac_lan": {
"state": {
"fan_mode": {
"silent": "Silent",
"full": "Full"
}
}
}
},
"entity": {
"climate": {
"state": {
"fan_mode": {
"silent": "Silent",
"full": "Full"
}
},
"midea_ac_lan": {
"state_attributes": {
"fan_mode": {
"silent": "Silent",
"full": "Full"
}
}
}
}
}
}
also tried with :
"entity_component": {
"climate": {
"state": {
"silent": "Silent",
"full": "Full"
}
}
},
but the translate in en.json still can’t works for the web UI, transltae value always the original slient and full , any changes in en.json can’t show in web UI, as it always display the origin english value in climate.py with
FAN_SILENT = "silent"
FAN_FULL_SPEED = "full"
any suggestion or debug steps?