Add preheating HVAC action to climate (#94677)

* Add preheating HVAC action to climate

* Fix MQTT tests
This commit is contained in:
Franck Nijhof 2023-06-16 04:16:12 +02:00 committed by GitHub
parent 26be0fab78
commit be05a749c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 1 deletions

View file

@ -96,6 +96,7 @@ class HVACAction(StrEnum):
HEATING = "heating"
IDLE = "idle"
OFF = "off"
PREHEATING = "preheating"
# These CURRENT_HVAC_* constants are deprecated as of Home Assistant 2022.5.

View file

@ -54,6 +54,7 @@
"name": "Current action",
"state": {
"off": "Off",
"preheating": "Preheating",
"heating": "Heating",
"cooling": "Cooling",
"drying": "Drying",

View file

@ -966,7 +966,7 @@ async def test_handle_action_received(
hvac_action = state.attributes.get(ATTR_HVAC_ACTION)
assert hvac_action is None
# Redefine actions according to https://developers.home-assistant.io/docs/core/entity/climate/#hvac-action
actions = ["off", "heating", "cooling", "drying", "idle", "fan"]
actions = ["off", "preheating", "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)