Skip to content

Commit

Permalink
Add defrosting as HVACAction in ClimateEntity (#121448)
Browse files Browse the repository at this point in the history
  • Loading branch information
gjohansson-ST authored Jul 7, 2024
1 parent 2def33b commit 26bc371
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
1 change: 1 addition & 0 deletions homeassistant/components/climate/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class HVACAction(StrEnum):
"""HVAC action for climate devices."""

COOLING = "cooling"
DEFROSTING = "defrosting"
DRYING = "drying"
FAN = "fan"
HEATING = "heating"
Expand Down
1 change: 1 addition & 0 deletions homeassistant/components/climate/icons.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"default": "mdi:circle-medium",
"state": {
"cooling": "mdi:snowflake",
"defrosting": "mdi:snowflake-melt",
"drying": "mdi:water-percent",
"fan": "mdi:fan",
"heating": "mdi:fire",
Expand Down
9 changes: 5 additions & 4 deletions homeassistant/components/climate/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,14 @@
"hvac_action": {
"name": "Current action",
"state": {
"off": "[%key:common::state::off%]",
"preheating": "Preheating",
"heating": "Heating",
"cooling": "Cooling",
"defrosting": "Defrosting",
"drying": "Drying",
"fan": "Fan",
"heating": "Heating",
"idle": "[%key:common::state::idle%]",
"fan": "Fan"
"off": "[%key:common::state::off%]",
"preheating": "Preheating"
}
},
"hvac_modes": {
Expand Down
11 changes: 10 additions & 1 deletion tests/components/mqtt/test_climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,16 @@ async def test_handle_action_received(

# Cycle through valid modes
# Redefine actions according to https://developers.home-assistant.io/docs/core/entity/climate/#hvac-action
actions = ["off", "preheating", "heating", "cooling", "drying", "idle", "fan"]
actions = [
"off",
"preheating",
"defrosting",
"heating",
"cooling",
"drying",
"idle",
"fan",
]
assert all(elem in actions for elem in HVACAction)
for action in actions:
async_fire_mqtt_message(hass, "action", action)
Expand Down

0 comments on commit 26bc371

Please sign in to comment.