Add defrosting as HVACAction in ClimateEntity (#121448)

This commit is contained in:
G Johansson 2024-07-07 18:54:40 +02:00 committed by GitHub
parent 2def33b168
commit 26bc37195e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 17 additions and 5 deletions

View file

@ -97,6 +97,7 @@ class HVACAction(StrEnum):
"""HVAC action for climate devices."""
COOLING = "cooling"
DEFROSTING = "defrosting"
DRYING = "drying"
FAN = "fan"
HEATING = "heating"

View file

@ -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",

View file

@ -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": {

View file

@ -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)