diff --git a/pyasic/miners/miner_factory.py b/pyasic/miners/miner_factory.py index 52d6dc32..db972646 100644 --- a/pyasic/miners/miner_factory.py +++ b/pyasic/miners/miner_factory.py @@ -536,14 +536,15 @@ class MinerFactory(metaclass=Singleton): if not model: stats = await self._send_api_command(str(ip), "stats") if stats: - if stats["STATS"][0].get("Type"): - _model = stats["STATS"][0]["Type"].upper() - if " BB" in _model: - _model = _model.split(" BB")[0] - if " XILINX" in _model: - _model = _model.split(" XILINX")[0] - if "PRO" in _model and not " PRO" in _model: - model = _model.replace("PRO", " PRO") + if "STATS" in stats.keys(): + if stats["STATS"][0].get("Type"): + _model = stats["STATS"][0]["Type"].upper() + if " BB" in _model: + _model = _model.split(" BB")[0] + if " XILINX" in _model: + _model = _model.split(" XILINX")[0] + if "PRO" in _model and not " PRO" in _model: + model = _model.replace("PRO", " PRO") if model: # whatsminer have a V in their version string (M20SV41), remove everything after it