diff --git a/pyproject.toml b/pyproject.toml index 59592eb..421f09b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "sessypy" -version = "0.2.5" +version = "0.2.6" authors = [ { name="PimDoos" }, ] diff --git a/setup.cfg b/setup.cfg index a8f04af..8d62fe1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = sessypy -version = 0.2.5 +version = 0.2.6 author = PimDoos url = https://github.com/PimDoos/sessypy long_description = file: README.md diff --git a/src/sessypy/devices.py b/src/sessypy/devices.py index 40f0827..711d75e 100644 --- a/src/sessypy/devices.py +++ b/src/sessypy/devices.py @@ -153,9 +153,11 @@ async def get_sessy_device(host: str, username: str, password: str) -> SessyDevi _LOGGER.debug(f"System info for {host}: {system_info}") except SessyConnectionException as e: _LOGGER.error(f"Failed to connect to {host}: {e}") + await api.close() raise SessyConnectionException from e except SessyNotSupportedException as e: _LOGGER.error(f"Device at {host} is not supported: {e}") + await api.close() raise SessyNotSupportedException from e