Add translations for xiaomi miio fan preset modes (#122367)

This commit is contained in:
Paul Bottein 2024-07-22 11:21:54 +02:00 committed by GitHub
parent 8d538fcd52
commit 33f0840a26
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 30 additions and 2 deletions

View file

@ -98,8 +98,8 @@ _LOGGER = logging.getLogger(__name__)
DATA_KEY = "fan.xiaomi_miio"
ATTR_MODE_NATURE = "Nature"
ATTR_MODE_NORMAL = "Normal"
ATTR_MODE_NATURE = "nature"
ATTR_MODE_NORMAL = "normal"
# Air Purifier
ATTR_BRIGHTNESS = "brightness"
@ -845,6 +845,8 @@ class XiaomiAirFreshT2017(XiaomiAirFreshA1):
class XiaomiGenericFan(XiaomiGenericDevice):
"""Representation of a generic Xiaomi Fan."""
_attr_translation_key = "generic_fan"
def __init__(self, device, entry, unique_id, coordinator):
"""Initialize the fan."""
super().__init__(device, entry, unique_id, coordinator)

View file

@ -1,4 +1,18 @@
{
"entity": {
"fan": {
"generic_fan": {
"state_attributes": {
"preset_mode": {
"state": {
"nature": "mdi:leaf",
"normal": "mdi:weather-windy"
}
}
}
}
}
},
"services": {
"fan_reset_filter": "mdi:refresh",
"fan_set_extra_features": "mdi:cog",

View file

@ -93,6 +93,18 @@
"high": "High"
}
}
},
"fan": {
"generic_fan": {
"state_attributes": {
"preset_mode": {
"state": {
"nature": "Nature",
"normal": "Normal"
}
}
}
}
}
},
"services": {