Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pyasic/miners/backends/luxminer.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,13 @@ async def _get_mac(self, rpc_config: dict | None = None) -> str | None:
rpc_config = await self.rpc.config()
except APIError:
pass
return None

if rpc_config is not None:
try:
return rpc_config["CONFIG"][0]["MACAddr"].upper()
except KeyError:
pass
return None

async def _get_hashrate(
self, rpc_summary: dict | None = None
Expand All @@ -249,16 +249,16 @@ async def _get_hashrate(
rpc_summary = await self.rpc.summary()
except APIError:
pass
return None

if rpc_summary is not None:
try:
return self.algo.hashrate(
rate=float(rpc_summary["SUMMARY"][0]["GHS 5s"]),
unit=self.algo.unit.GH,
).into(self.algo.unit.default)
unit=self.algo.unit.GH, # type: ignore[attr-defined]
).into(self.algo.unit.default) # type: ignore[attr-defined]
except (LookupError, ValueError, TypeError):
pass
return None

async def _get_hashboards(self, rpc_stats: dict | None = None) -> list[HashBoard]:
if self.expected_hashboards is None:
Expand Down