Add a check in _parse_type_from_version (#16)

This commit is contained in:
Arceris
2022-08-18 10:12:19 -06:00
committed by GitHub
parent 8e7d6751e2
commit 50ccfec1b3

View File

@@ -569,7 +569,12 @@ class MinerFactory(metaclass=Singleton):
# if all that fails, check the Description to see if it is a whatsminer
if version.get("Description") and ("whatsminer" in version.get("Description")):
api = "BTMiner"
# If version does not exist in the keys, return None (resulting in Unknown).
# Prevents halting on suspended miners that aren't returning valid information.
if "VERSION" not in version.keys():
return None, None, None
# check for avalonminers
if version["VERSION"][0].get("PROD"):
_data = version["VERSION"][0]["PROD"].split("-")