Allow EM heat on from any mode in Honeywell (#120750)
parent
38a30b343d
commit
a7246400b3
|
@ -71,13 +71,12 @@ class HoneywellSwitch(SwitchEntity):
|
|||
|
||||
async def async_turn_on(self, **kwargs: Any) -> None:
|
||||
"""Turn the switch on if heat mode is enabled."""
|
||||
if self._device.system_mode == "heat":
|
||||
try:
|
||||
await self._device.set_system_mode("emheat")
|
||||
except SomeComfortError as err:
|
||||
raise HomeAssistantError(
|
||||
translation_domain=DOMAIN, translation_key="switch_failed_on"
|
||||
) from err
|
||||
try:
|
||||
await self._device.set_system_mode("emheat")
|
||||
except SomeComfortError as err:
|
||||
raise HomeAssistantError(
|
||||
translation_domain=DOMAIN, translation_key="switch_failed_on"
|
||||
) from err
|
||||
|
||||
async def async_turn_off(self, **kwargs: Any) -> None:
|
||||
"""Turn the switch off if on."""
|
||||
|
|
|
@ -24,26 +24,6 @@ async def test_emheat_switch(
|
|||
|
||||
await init_integration(hass, config_entry)
|
||||
entity_id = f"switch.{device.name}_emergency_heat"
|
||||
await hass.services.async_call(
|
||||
SWITCH_DOMAIN,
|
||||
SERVICE_TURN_ON,
|
||||
{ATTR_ENTITY_ID: entity_id},
|
||||
blocking=True,
|
||||
)
|
||||
device.set_system_mode.assert_not_called()
|
||||
|
||||
device.set_system_mode.reset_mock()
|
||||
|
||||
await hass.services.async_call(
|
||||
SWITCH_DOMAIN,
|
||||
SERVICE_TURN_OFF,
|
||||
{ATTR_ENTITY_ID: entity_id},
|
||||
blocking=True,
|
||||
)
|
||||
device.set_system_mode.assert_not_called()
|
||||
|
||||
device.system_mode = "heat"
|
||||
|
||||
await hass.services.async_call(
|
||||
SWITCH_DOMAIN,
|
||||
SERVICE_TURN_ON,
|
||||
|
@ -53,6 +33,7 @@ async def test_emheat_switch(
|
|||
device.set_system_mode.assert_called_once_with("emheat")
|
||||
|
||||
device.set_system_mode.reset_mock()
|
||||
|
||||
device.system_mode = "emheat"
|
||||
await hass.services.async_call(
|
||||
SWITCH_DOMAIN,
|
||||
|
|
Loading…
Reference in New Issue