Fix homekit_controller climate entity not becoming active when changing modes (#81868)
This commit is contained in:
parent
e690db9ba6
commit
9de4d7cba3
2 changed files with 37 additions and 0 deletions
|
@ -209,6 +209,7 @@ class HomeKitHeaterCoolerEntity(HomeKitBaseClimateEntity):
|
||||||
)
|
)
|
||||||
await self.async_put_characteristics(
|
await self.async_put_characteristics(
|
||||||
{
|
{
|
||||||
|
CharacteristicsTypes.ACTIVE: ActivationStateValues.ACTIVE,
|
||||||
CharacteristicsTypes.TARGET_HEATER_COOLER_STATE: TARGET_HEATER_COOLER_STATE_HASS_TO_HOMEKIT[
|
CharacteristicsTypes.TARGET_HEATER_COOLER_STATE: TARGET_HEATER_COOLER_STATE_HASS_TO_HOMEKIT[
|
||||||
hvac_mode
|
hvac_mode
|
||||||
],
|
],
|
||||||
|
|
|
@ -760,6 +760,42 @@ async def test_heater_cooler_change_thermostat_state(hass, utcnow):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
async def test_can_turn_on_after_off(hass, utcnow):
|
||||||
|
"""
|
||||||
|
Test that we always force device from inactive to active when setting mode.
|
||||||
|
|
||||||
|
This is a regression test for #81863.
|
||||||
|
"""
|
||||||
|
helper = await setup_test_component(hass, create_heater_cooler_service)
|
||||||
|
|
||||||
|
await hass.services.async_call(
|
||||||
|
DOMAIN,
|
||||||
|
SERVICE_SET_HVAC_MODE,
|
||||||
|
{"entity_id": "climate.testdevice", "hvac_mode": HVACMode.OFF},
|
||||||
|
blocking=True,
|
||||||
|
)
|
||||||
|
helper.async_assert_service_values(
|
||||||
|
ServicesTypes.HEATER_COOLER,
|
||||||
|
{
|
||||||
|
CharacteristicsTypes.ACTIVE: ActivationStateValues.INACTIVE,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
await hass.services.async_call(
|
||||||
|
DOMAIN,
|
||||||
|
SERVICE_SET_HVAC_MODE,
|
||||||
|
{"entity_id": "climate.testdevice", "hvac_mode": HVACMode.HEAT},
|
||||||
|
blocking=True,
|
||||||
|
)
|
||||||
|
helper.async_assert_service_values(
|
||||||
|
ServicesTypes.HEATER_COOLER,
|
||||||
|
{
|
||||||
|
CharacteristicsTypes.ACTIVE: ActivationStateValues.ACTIVE,
|
||||||
|
CharacteristicsTypes.TARGET_HEATER_COOLER_STATE: TargetHeaterCoolerStateValues.HEAT,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
async def test_heater_cooler_change_thermostat_temperature(hass, utcnow):
|
async def test_heater_cooler_change_thermostat_temperature(hass, utcnow):
|
||||||
"""Test that we can change the target temperature."""
|
"""Test that we can change the target temperature."""
|
||||||
helper = await setup_test_component(hass, create_heater_cooler_service)
|
helper = await setup_test_component(hass, create_heater_cooler_service)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue