added Hive get bad boards, and started on a bad board utility

This commit is contained in:
UpstreamData
2022-01-21 16:15:46 -07:00
parent a1839aae46
commit a93027369e
10 changed files with 82 additions and 10 deletions

View File

@@ -174,10 +174,12 @@ If you are sure you want to use this command please use API.send_command("{item}
str_data = str_data.replace("\n", "")
# fix an error with a bmminer return not having a specific comma that breaks json.loads()
str_data = str_data.replace("}{", "},{")
# fix an error with a bmminer return having a specific comma that breaks json.loads()
str_data = str_data.replace("[,{", "[{")
# parse the json
parsed_data = json.loads(str_data)
# handle bad json
except json.decoder.JSONDecodeError as e:
print(e)
raise APIError(f"Decode Error: {data}")
raise APIError(f"Decode Error: {str_data}")
return parsed_data