added comments and docstrings to some files

This commit is contained in:
Dellsauce
2021-11-03 14:39:28 -07:00
parent da8d45a9b1
commit 2b61c042b8
3 changed files with 20 additions and 2 deletions

View File

@@ -135,7 +135,7 @@ class BaseMinerAPI:
return True
@staticmethod
def load_api_data(data: bytes) -> None:
def load_api_data(data: bytes) -> dict:
"""Convert API data from JSON to dict"""
try:
# some json from the API returns with a null byte (\x00) on the end
@@ -148,3 +148,4 @@ class BaseMinerAPI:
# handle bad json
except json.decoder.JSONDecodeError:
raise APIError(f"Decode Error: {data}")
return data