fix a bug with whatsminer crashing if hitting a S19 condition
This commit is contained in:
@@ -536,14 +536,15 @@ class MinerFactory(metaclass=Singleton):
|
|||||||
if not model:
|
if not model:
|
||||||
stats = await self._send_api_command(str(ip), "stats")
|
stats = await self._send_api_command(str(ip), "stats")
|
||||||
if stats:
|
if stats:
|
||||||
if stats["STATS"][0].get("Type"):
|
if "STATS" in stats.keys():
|
||||||
_model = stats["STATS"][0]["Type"].upper()
|
if stats["STATS"][0].get("Type"):
|
||||||
if " BB" in _model:
|
_model = stats["STATS"][0]["Type"].upper()
|
||||||
_model = _model.split(" BB")[0]
|
if " BB" in _model:
|
||||||
if " XILINX" in _model:
|
_model = _model.split(" BB")[0]
|
||||||
_model = _model.split(" XILINX")[0]
|
if " XILINX" in _model:
|
||||||
if "PRO" in _model and not " PRO" in _model:
|
_model = _model.split(" XILINX")[0]
|
||||||
model = _model.replace("PRO", " PRO")
|
if "PRO" in _model and not " PRO" in _model:
|
||||||
|
model = _model.replace("PRO", " PRO")
|
||||||
|
|
||||||
if model:
|
if model:
|
||||||
# whatsminer have a V in their version string (M20SV41), remove everything after it
|
# whatsminer have a V in their version string (M20SV41), remove everything after it
|
||||||
|
|||||||
Reference in New Issue
Block a user