Skip to content

Commit c7fdaa5

Browse files
committed
Test error 400 back on turn off
* tests/test_init.py:
1 parent 1f31a0e commit c7fdaa5

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/test_init.py

+23
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,29 @@ async def test_water_heater(
572572

573573
assert len(responses.calls) == 9
574574

575+
responses.patch(
576+
DAIKIN_API_URL
577+
+ "/v1/gateway-devices/1ece521b-5401-4a42-acce-6f76fba246aa/management-points/domesticHotWaterTank/characteristics/onOffMode",
578+
status=400,
579+
)
580+
581+
# Turn the tank off, this should fail and not work
582+
try:
583+
await hass.services.async_call(
584+
WATER_HEATER_DOMAIN,
585+
SERVICE_TURN_OFF,
586+
{ATTR_ENTITY_ID: "water_heater.altherma"},
587+
blocking=True,
588+
)
589+
except Exception as e:
590+
assert len(responses.calls) == 10
591+
592+
await hass.async_block_till_done()
593+
594+
assert len(responses.calls) == 10
595+
assert responses.calls[9].request.body == '{"value": "off"}'
596+
assert hass.states.get("water_heater.altherma").attributes["operation_mode"] == STATE_HEAT_PUMP
597+
575598

576599
@responses.activate
577600
async def test_climate(

0 commit comments

Comments
 (0)