refactor: swap except (KeyError, ValueError) to except LookupError.
This commit is contained in:
@@ -378,7 +378,7 @@ class BOSMiner(BaseMiner):
|
||||
if api_version:
|
||||
try:
|
||||
api_ver = api_version["VERSION"][0]["API"]
|
||||
except (KeyError, IndexError):
|
||||
except LookupError:
|
||||
api_ver = None
|
||||
self.api_ver = api_ver
|
||||
self.api.api_ver = self.api_ver
|
||||
@@ -446,7 +446,7 @@ class BOSMiner(BaseMiner):
|
||||
d = {}
|
||||
try:
|
||||
api_temps = d["temps"][0]
|
||||
except (KeyError, IndexError):
|
||||
except LookupError:
|
||||
api_temps = None
|
||||
try:
|
||||
api_devdetails = d["devdetails"][0]
|
||||
@@ -454,7 +454,7 @@ class BOSMiner(BaseMiner):
|
||||
api_devdetails = None
|
||||
try:
|
||||
api_devs = d["devs"][0]
|
||||
except (KeyError, IndexError):
|
||||
except LookupError:
|
||||
api_devs = None
|
||||
if api_temps:
|
||||
try:
|
||||
@@ -509,7 +509,7 @@ class BOSMiner(BaseMiner):
|
||||
return api_tunerstatus["TUNERSTATUS"][0][
|
||||
"ApproximateMinerPowerConsumption"
|
||||
]
|
||||
except (KeyError, IndexError):
|
||||
except LookupError:
|
||||
pass
|
||||
|
||||
async def get_wattage_limit(self, api_tunerstatus: dict = None) -> Optional[int]:
|
||||
@@ -522,7 +522,7 @@ class BOSMiner(BaseMiner):
|
||||
if api_tunerstatus:
|
||||
try:
|
||||
return api_tunerstatus["TUNERSTATUS"][0]["PowerLimit"]
|
||||
except (KeyError, IndexError):
|
||||
except LookupError:
|
||||
pass
|
||||
|
||||
async def get_fans(self, api_fans: dict = None) -> List[Fan]:
|
||||
|
||||
Reference in New Issue
Block a user