Add missing disconnect in elkm1 config flow validation (#67716)

This commit is contained in:
J. Nick Koston
2022-03-05 22:02:45 -10:00
committed by GitHub
parent 26c5dca45d
commit 23b218bc44

View File

@@ -81,8 +81,11 @@ async def validate_input(data: dict[str, str], mac: str | None) -> dict[str, str
) )
elk.connect() elk.connect()
if not await async_wait_for_elk_to_sync(elk, LOGIN_TIMEOUT, VALIDATE_TIMEOUT): try:
raise InvalidAuth if not await async_wait_for_elk_to_sync(elk, LOGIN_TIMEOUT, VALIDATE_TIMEOUT):
raise InvalidAuth
finally:
elk.disconnect()
short_mac = _short_mac(mac) if mac else None short_mac = _short_mac(mac) if mac else None
if prefix and prefix != short_mac: if prefix and prefix != short_mac: