Skip to content

Commit

Permalink
fix: read me corrections (#16)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
cdnninja and pre-commit-ci[bot] authored Apr 15, 2024
1 parent 9f7ba30 commit cdda6de
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Credits
Development Lead
----------------

*
*

Contributors
------------
Expand Down
4 changes: 3 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -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::

Expand All @@ -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)
13 changes: 5 additions & 8 deletions yoto_api/YotoManager.py
Original file line number Diff line number Diff line change
@@ -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__)

Expand All @@ -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

Expand All @@ -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

0 comments on commit cdda6de

Please sign in to comment.