Compare commits

...

4 Commits

Author SHA1 Message Date
Brett Rowan
a0fdec3ce5 version: bump version number 2025-08-16 10:06:58 -06:00
Brett Rowan
1a8928de18 feature: add retries to elphapex 2025-08-16 10:06:46 -06:00
Brett Rowan
bce0058930 version: bump version number 2025-08-16 09:38:24 -06:00
Brett Rowan
850656fce4 bug: fix elphapex hashboard parsing 2025-08-16 09:38:06 -06:00
3 changed files with 27 additions and 16 deletions

View File

@@ -233,6 +233,7 @@ class ElphapexMiner(StockFirmware):
board_temp_data = list( board_temp_data = list(
filter(lambda x: not x == 0, board["temp_pcb"]) filter(lambda x: not x == 0, board["temp_pcb"])
) )
if not len(board_temp_data) == 0:
hashboards[board["index"]].temp = sum(board_temp_data) / len( hashboards[board["index"]].temp = sum(board_temp_data) / len(
board_temp_data board_temp_data
) )

View File

@@ -120,6 +120,7 @@ class ElphapexWebAPI(BaseWebAPI):
""" """
auth = httpx.DigestAuth(self.username, self.pwd) auth = httpx.DigestAuth(self.username, self.pwd)
async def _send():
try: try:
url = f"http://{self.ip}/cgi-bin/{command}.cgi" url = f"http://{self.ip}/cgi-bin/{command}.cgi"
ret = await client.get(url, auth=auth) ret = await client.get(url, auth=auth)
@@ -129,9 +130,18 @@ class ElphapexWebAPI(BaseWebAPI):
if ret.status_code == 200: if ret.status_code == 200:
try: try:
json_data = ret.json() json_data = ret.json()
if json_data.get("STATUS", {}).get("STATUS") not in ["S", "I"]:
return None
return {command: json_data} return {command: json_data}
except json.decoder.JSONDecodeError: except json.decoder.JSONDecodeError:
pass pass
return None
# retry 3 times
for i in range(3):
res = await _send()
if res is not None:
return res
return {command: {}} return {command: {}}
async def get_miner_conf(self) -> dict: async def get_miner_conf(self) -> dict:

View File

@@ -1,6 +1,6 @@
[project] [project]
name = "pyasic" name = "pyasic"
version = "0.76.1" version = "0.76.3"
description = "A simplified and standardized interface for Bitcoin ASICs." description = "A simplified and standardized interface for Bitcoin ASICs."
authors = [{name = "UpstreamData", email = "brett@upstreamdata.ca"}] authors = [{name = "UpstreamData", email = "brett@upstreamdata.ca"}]