diff --git a/AUTHORS.rst b/AUTHORS.rst index 525f787..52989f5 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -5,7 +5,7 @@ Credits Development Lead ---------------- -* +* Contributors ------------ diff --git a/README.rst b/README.rst index a43abb4..ba5fa44 100644 --- a/README.rst +++ b/README.rst @@ -1,7 +1,7 @@ Introduction ============ -Early days of this API. Plan is to use this for home assistant. Basics are only item build for auth so far. +Early days of this API. Plan is to use this for home assistant. Basics are only item build for auth so far. To run this code for test I am doing:: @@ -18,4 +18,6 @@ To run this code for test I am doing:: logger = logging.getLogger(**name**) ym = YotoManager(username="username", password="password") + ym.check_and_refresh_token() + ym.update_player_status() print (ym.players) diff --git a/yoto_api/YotoManager.py b/yoto_api/YotoManager.py index 536046b..42d0922 100644 --- a/yoto_api/YotoManager.py +++ b/yoto_api/YotoManager.py @@ -1,11 +1,8 @@ """YotoManager.py""" import logging -import datetime as dt -import pytz from .YotoAPI import YotoAPI from .Token import Token -from .const import DOMAIN _LOGGER = logging.getLogger(__name__) @@ -16,7 +13,7 @@ def __init__(self, username: str, password: str) -> None: self.password: str = password self.api: YotoAPI = YotoAPI() self.players: dict = {} - self.token: Token = None + self.token: Token = None self.players: list = None self.library: list = None @@ -37,8 +34,8 @@ def check_and_refresh_token(self) -> bool: if self.token is None: self.initialize() # Check if valid and correct if not - #if self.token.valid_until <= dt.datetime.now(pytz.utc): - #_LOGGER.debug(f"{DOMAIN} - Refresh token expired") - #self.token: Token = self.api.refresh_token(self.token) + # if self.token.valid_until <= dt.datetime.now(pytz.utc): + # _LOGGER.debug(f"{DOMAIN} - Refresh token expired") + # self.token: Token = self.api.refresh_token(self.token) return True - #return False + # return False