fixed some of the issues with newer whatsminers not scanning properly because of their API, still a bug with asyncio

This commit is contained in:
UpstreamData
2021-10-28 09:55:33 -06:00
parent 1ba5199acd
commit 26ecdde6d4
3 changed files with 51 additions and 8 deletions

View File

@@ -72,7 +72,10 @@ class BaseMinerAPI:
print(e)
try:
data = json.loads(data.decode('utf-8')[:-1])
if data.endswith(b"\x00"):
data = json.loads(data.decode('utf-8')[:-1])
else:
data = json.loads(data.decode('utf-8'))
except json.decoder.JSONDecodeError:
raise APIError(f"Decode Error: {data}")