diff --git a/vivintpy/account.py b/vivintpy/account.py index 654428f..e80a7b2 100644 --- a/vivintpy/account.py +++ b/vivintpy/account.py @@ -65,6 +65,11 @@ def connected(self) -> bool: """Return True if connected.""" return self.__connected + @property + def refresh_token(self) -> str | None: + """Return the refresh token.""" + return self.api.tokens.get("refresh_token") + async def connect( self, load_devices: bool = False, subscribe_for_realtime_updates: bool = False ) -> None: diff --git a/vivintpy/vivintskyapi.py b/vivintpy/vivintskyapi.py index 7d1d24d..bc05b70 100644 --- a/vivintpy/vivintskyapi.py +++ b/vivintpy/vivintskyapi.py @@ -60,6 +60,11 @@ def __init__( self.__mfa_type = "code" self.__token: dict | None = None + @property + def tokens(self) -> dict: + """Return the tokens, if any.""" + return self.__token or {} + def is_session_valid(self) -> bool: """Return `True` if the token is still valid.""" if self.__token is None: