Skip to content
This repository was archived by the owner on Jul 6, 2026. It is now read-only.

Commit 4240135

Browse files
committed
bug: fix split command parsing issue
1 parent 0306eda commit 4240135

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

pyasic/miners/backends/btminer.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
# ------------------------------------------------------------------------------
1616
import asyncio
1717
import logging
18-
from typing import Optional
1918

2019
import aiofiles
2120
import semver
@@ -24,7 +23,6 @@
2423
from pyasic.data import Fan, HashBoard
2524
from pyasic.data.error_codes import MinerErrorData, WhatsminerError
2625
from pyasic.data.pools import PoolMetrics, PoolUrl
27-
from pyasic.device import MinerAlgo
2826
from pyasic.device.algorithm import AlgoHashRateType
2927
from pyasic.errors import APIError
3028
from pyasic.miners.data import DataFunction, DataLocations, DataOptions, RPCAPICommand

pyasic/rpc/btminer.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,13 +248,12 @@ async def multicommand(self, *commands: str, allow_warning: bool = True) -> dict
248248
# standard multicommand format is "command1+command2"
249249
# commands starting with "get_" and the "status" command aren't supported, but we can fake that
250250

251-
split_commands = []
251+
split_commands = list(
252+
filter(lambda x: x.startswith("get_") or x == "status", commands_list)
253+
)
252254

253-
for command in commands_list:
254-
if command.startswith("get_") or command == "status":
255-
commands_list.remove(command)
256-
# send seperately and append later
257-
split_commands.append(command)
255+
for cmd in split_commands:
256+
commands_list.remove(cmd)
258257

259258
command = "+".join(commands_list)
260259

0 commit comments

Comments
 (0)