Skip to content

Commit

Permalink
Merge pull request #104 from Robbe-B/icons_presets
Browse files Browse the repository at this point in the history
Add Icons to preset modes of Climate and Fan entities
  • Loading branch information
Robbe-B authored Feb 8, 2024
2 parents a51fae2 + 5d3d6f0 commit b58b531
Show file tree
Hide file tree
Showing 6 changed files with 121 additions and 0 deletions.
1 change: 1 addition & 0 deletions custom_components/maestro_mcz/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class MczClimateEntity(CoordinatorEntity, ClimateEntity):
_attr_current_temperature = None
_attr_target_temperature = None
_attr_preset_mode = None
_attr_translation_key: str = "main_climate"

_enable_turn_on_off_backwards_compatibility = False # to be removed after 2025.1

Expand Down
1 change: 1 addition & 0 deletions custom_components/maestro_mcz/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class MczFanEntity(CoordinatorEntity, FanEntity):
_attr_preset_mode: str | None = None
_attr_preset_modes: list[str] | None = None
_attr_speed_count: int = 0
_attr_translation_key: str = "main_fan"
#
_supported_fan: models.FanMczConfigItem | None = None
_fan_configuration: SensorConfigurationMultipleModes | None = None
Expand Down
32 changes: 32 additions & 0 deletions custom_components/maestro_mcz/icons.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"entity": {
"climate": {
"main_climate": {
"state_attributes": {
"preset_mode": {
"default": "mdi:confused",
"state": {
"manual": "mdi:hand-back-right",
"auto": "mdi:thermometer-auto",
"overnight": "mdi:weather-night",
"comfort": "mdi:home-heart",
"turbo": "mdi:fire"
}
}
}
}
},
"fan": {
"main_fan": {
"state_attributes": {
"preset_mode": {
"state": {
"auto": "mdi:fan-auto",
"silent": "mdi:fan-off"
}
}
}
}
}
}
}
29 changes: 29 additions & 0 deletions custom_components/maestro_mcz/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,34 @@
}
}
}
},
"entity": {
"climate": {
"main_climate": {
"state_attributes": {
"preset_mode": {
"state": {
"manual": "Manual",
"auto": "Auto",
"overnight": "Overnight",
"comfort": "Comfort",
"turbo": "Turbo"
}
}
}
}
},
"fan": {
"main_fan": {
"state_attributes": {
"preset_mode": {
"state": {
"auto": "Auto",
"silent": "Silent"
}
}
}
}
}
}
}
29 changes: 29 additions & 0 deletions custom_components/maestro_mcz/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,34 @@
}
}
}
},
"entity": {
"climate": {
"main_climate": {
"state_attributes": {
"preset_mode": {
"state": {
"manual": "Manual",
"auto": "Auto",
"overnight": "Overnight",
"comfort": "Comfort",
"turbo": "Turbo"
}
}
}
}
},
"fan": {
"main_fan": {
"state_attributes": {
"preset_mode": {
"state": {
"auto": "Auto",
"silent": "Silent"
}
}
}
}
}
}
}
29 changes: 29 additions & 0 deletions custom_components/maestro_mcz/translations/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,34 @@
}
}
}
},
"entity": {
"climate": {
"main_climate": {
"state_attributes": {
"preset_mode": {
"state": {
"manual": "Manual",
"auto": "Auto",
"overnight": "Overnight",
"comfort": "Comfort",
"turbo": "Turbo"
}
}
}
}
},
"fan": {
"main_fan": {
"state_attributes": {
"preset_mode": {
"state": {
"auto": "Auto",
"silent": "Silent"
}
}
}
}
}
}
}

0 comments on commit b58b531

Please sign in to comment.