Bump aioesphomeapi to 18.2.4 (#103552)

This commit is contained in:
J. Nick Koston 2023-11-07 04:22:41 -06:00 committed by GitHub
parent ef7a3787bb
commit 2a80164508
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 5 deletions

View File

@ -16,7 +16,7 @@
"loggers": ["aioesphomeapi", "noiseprotocol"],
"requirements": [
"async-interrupt==1.1.1",
"aioesphomeapi==18.2.1",
"aioesphomeapi==18.2.4",
"bluetooth-data-tools==1.14.0",
"esphome-dashboard-api==1.2.3"
],

View File

@ -237,7 +237,7 @@ aioecowitt==2023.5.0
aioemonitor==1.0.5
# homeassistant.components.esphome
aioesphomeapi==18.2.1
aioesphomeapi==18.2.4
# homeassistant.components.flo
aioflo==2021.11.0

View File

@ -218,7 +218,7 @@ aioecowitt==2023.5.0
aioemonitor==1.0.5
# homeassistant.components.esphome
aioesphomeapi==18.2.1
aioesphomeapi==18.2.4
# homeassistant.components.flo
aioflo==2021.11.0

View File

@ -77,6 +77,17 @@ def mock_config_entry(hass) -> MockConfigEntry:
return config_entry
class BaseMockReconnectLogic(ReconnectLogic):
"""Mock ReconnectLogic."""
def stop_callback(self) -> None:
"""Stop the reconnect logic."""
# For the purposes of testing, we don't want to wait
# for the reconnect logic to finish trying to connect
self._cancel_connect("forced disconnect from test")
self._is_stopped = True
@pytest.fixture
def mock_device_info() -> DeviceInfo:
"""Return the default mocked device info."""
@ -132,7 +143,10 @@ def mock_client(mock_device_info) -> APIClient:
mock_client.address = "127.0.0.1"
mock_client.api_version = APIVersion(99, 99)
with patch("homeassistant.components.esphome.APIClient", mock_client), patch(
with patch(
"homeassistant.components.esphome.manager.ReconnectLogic",
BaseMockReconnectLogic,
), patch("homeassistant.components.esphome.APIClient", mock_client), patch(
"homeassistant.components.esphome.config_flow.APIClient", mock_client
):
yield mock_client
@ -234,7 +248,7 @@ async def _mock_generic_device_entry(
try_connect_done = Event()
class MockReconnectLogic(ReconnectLogic):
class MockReconnectLogic(BaseMockReconnectLogic):
"""Mock ReconnectLogic."""
def __init__(self, *args, **kwargs):
@ -250,6 +264,13 @@ async def _mock_generic_device_entry(
try_connect_done.set()
return result
def stop_callback(self) -> None:
"""Stop the reconnect logic."""
# For the purposes of testing, we don't want to wait
# for the reconnect logic to finish trying to connect
self._cancel_connect("forced disconnect from test")
self._is_stopped = True
with patch(
"homeassistant.components.esphome.manager.ReconnectLogic", MockReconnectLogic
):