Skip to content

Commit

Permalink
Merge pull request #364 from jwillemsen/jwi-exceptionahdn
Browse files Browse the repository at this point in the history
Test rate limit on schedule selection
  • Loading branch information
jwillemsen authored Nov 29, 2024
2 parents 8241a5f + 76e7985 commit efb2363
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,25 @@ async def test_climate(
assert responses.calls[32].request.body == '{"value": "windNice", "path": "/operationModes/cooling/fanDirection/vertical/currentMode"}'
assert hass.states.get("climate.werkkamer_room_temperature").attributes["swing_mode"] == "windnice"

responses.put(
DAIKIN_API_URL
+ "/v1/gateway-devices/1ece521b-5401-4a42-acce-6f76fba246aa/management-points/climateControlMainZone/schedule/cooling/current",
status=429,
headers={"X-RateLimit-Limit-minute": "0", "X-RateLimit-Limit-day": "0"},
)
# Set the device with schedule 'User defined' enabled, this should fail due to the rate limit
await hass.services.async_call(
SELECT_DOMAIN,
SERVICE_SELECT_OPTION,
{ATTR_ENTITY_ID: "select.altherma_climatecontrol_schedule", ATTR_OPTION: "User defined"},
blocking=True,
)
await hass.async_block_till_done()

assert len(responses.calls) == 34
assert responses.calls[33].request.body == '{"scheduleId": "scheduleCoolingRT1", "enabled": true}'
assert hass.states.get("select.altherma_climatecontrol_schedule").state == SCHEDULE_OFF


async def test_minimal_data(
hass: HomeAssistant,
Expand Down

0 comments on commit efb2363

Please sign in to comment.