Skip to content

Commit

Permalink
fix: close session only if available (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
chemelli74 committed Nov 28, 2023
1 parent 7d054cd commit 2acca97
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/aiocomelit/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ async def logout(self) -> None:

async def close(self) -> None:
"""Comelit Simple Home close session."""
await self._session.close()
if hasattr(self, "_session"):
await self._session.close()


class ComeliteSerialBridgeApi(ComelitCommonApi):
Expand Down

0 comments on commit 2acca97

Please sign in to comment.