Bump aiohomekit to 3.0.7 (#102408)

This commit is contained in:
J. Nick Koston 2023-10-20 11:08:41 -10:00 committed by GitHub
parent b70262fe8c
commit f51743f123
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 10 deletions

View file

@ -7,6 +7,9 @@ from aiohomekit.model import CharacteristicsTypes, ServicesTypes
from aiohomekit.testing import FakePairing
import pytest
from homeassistant.components.homekit_controller.connection import (
MAX_POLL_FAILURES_TO_DECLARE_UNAVAILABLE,
)
from homeassistant.core import HomeAssistant
import homeassistant.util.dt as dt_util
@ -26,8 +29,6 @@ async def test_recover_from_failure(hass: HomeAssistant, utcnow, failure_cls) ->
accessories = await setup_accessories_from_file(hass, "koogeek_ls1.json")
config_entry, pairing = await setup_test_accessories(hass, accessories)
pairing.testing.events_enabled = False
helper = Helper(
hass,
"light.koogeek_ls1_20833f_light_strip",
@ -49,11 +50,10 @@ async def test_recover_from_failure(hass: HomeAssistant, utcnow, failure_cls) ->
with mock.patch.object(FakePairing, "get_characteristics") as get_char:
get_char.side_effect = failure_cls("Disconnected")
# Set light state on fake device to on
state = await helper.async_update(
ServicesTypes.LIGHTBULB, {CharacteristicsTypes.ON: True}
)
assert state.state == "off"
# Test that a poll triggers unavailable
for _ in range(MAX_POLL_FAILURES_TO_DECLARE_UNAVAILABLE + 2):
state = await helper.poll_and_get_state()
assert state.state == "unavailable"
chars = get_char.call_args[0][0]
assert set(chars) == {(1, 8), (1, 9), (1, 10), (1, 11)}