mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 10:59:40 +00:00
Use fan mode when heat/cool is idle in homekit_controller (#128618)
This commit is contained in:
@@ -6,6 +6,7 @@ from aiohomekit.model import Accessory
|
||||
from aiohomekit.model.characteristics import (
|
||||
ActivationStateValues,
|
||||
CharacteristicsTypes,
|
||||
CurrentFanStateValues,
|
||||
CurrentHeaterCoolerStateValues,
|
||||
SwingModeValues,
|
||||
TargetHeaterCoolerStateValues,
|
||||
@@ -66,6 +67,9 @@ def create_thermostat_service(accessory: Accessory) -> None:
|
||||
char = service.add_char(CharacteristicsTypes.RELATIVE_HUMIDITY_CURRENT)
|
||||
char.value = 0
|
||||
|
||||
char = service.add_char(CharacteristicsTypes.FAN_STATE_CURRENT)
|
||||
char.value = 0
|
||||
|
||||
|
||||
def create_thermostat_service_min_max(accessory: Accessory) -> None:
|
||||
"""Define thermostat characteristics."""
|
||||
@@ -648,6 +652,18 @@ async def test_hvac_mode_vs_hvac_action(
|
||||
assert state.state == "heat"
|
||||
assert state.attributes["hvac_action"] == "idle"
|
||||
|
||||
# Simulate the fan running while the heat/cool is idle
|
||||
await helper.async_update(
|
||||
ServicesTypes.THERMOSTAT,
|
||||
{
|
||||
CharacteristicsTypes.FAN_STATE_CURRENT: CurrentFanStateValues.ACTIVE,
|
||||
},
|
||||
)
|
||||
|
||||
state = await helper.poll_and_get_state()
|
||||
assert state.state == "heat"
|
||||
assert state.attributes["hvac_action"] == "fan"
|
||||
|
||||
# Simulate that current temperature is below target temp
|
||||
# Heating might be on and hvac_action currently 'heat'
|
||||
await helper.async_update(
|
||||
|
||||
Reference in New Issue
Block a user