Fix keymitt_ble RuntimeWarning (#97729)

This commit is contained in:
Marc Mueller 2023-08-04 09:34:04 +02:00 committed by GitHub
parent b16254a0de
commit 99145d46d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -138,7 +138,7 @@ class MicroBotConfigFlow(ConfigFlow, domain=DOMAIN):
await self._client.connect(init=True) await self._client.connect(init=True)
return self.async_show_form(step_id="link") return self.async_show_form(step_id="link")
if not self._client.is_connected(): if not await self._client.is_connected():
errors["base"] = "linking" errors["base"] = "linking"
else: else:
await self._client.disconnect() await self._client.disconnect()

View File

@ -77,6 +77,6 @@ class MockMicroBotApiClientFail:
async def disconnect(self): async def disconnect(self):
"""Mock disconnect.""" """Mock disconnect."""
def is_connected(self): async def is_connected(self):
"""Mock disconnected.""" """Mock disconnected."""
return False return False