Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
11295f27a7 | ||
|
|
55aa3dd85b | ||
|
|
20272d4360 | ||
|
|
623dc92ef2 | ||
|
|
2d59394b1e | ||
|
|
26c2095ff1 |
@@ -338,13 +338,16 @@ class MinerData:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def asdict(self) -> dict:
|
def asdict(self) -> dict:
|
||||||
|
logging.debug(f"MinerData - (To Dict) - Dumping Dict data")
|
||||||
|
return asdict(self)
|
||||||
|
|
||||||
|
def as_dict(self) -> dict:
|
||||||
"""Get this dataclass as a dictionary.
|
"""Get this dataclass as a dictionary.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
A dictionary version of this class.
|
A dictionary version of this class.
|
||||||
"""
|
"""
|
||||||
logging.debug(f"MinerData - (To Dict) - Dumping Dict data")
|
return self.asdict()
|
||||||
return asdict(self)
|
|
||||||
|
|
||||||
def as_json(self) -> str:
|
def as_json(self) -> str:
|
||||||
"""Get this dataclass as JSON.
|
"""Get this dataclass as JSON.
|
||||||
|
|||||||
@@ -238,9 +238,12 @@ class BMMiner(BaseMiner):
|
|||||||
real_slots = []
|
real_slots = []
|
||||||
|
|
||||||
for i in range(board_offset, board_offset + 4):
|
for i in range(board_offset, board_offset + 4):
|
||||||
key = f'chain_acs{i}'
|
try:
|
||||||
if boards[1][key] != '':
|
key = f'chain_acs{i}'
|
||||||
real_slots.append(i)
|
if boards[1].get(key, '') != '':
|
||||||
|
real_slots.append(i)
|
||||||
|
except LookupError:
|
||||||
|
pass
|
||||||
|
|
||||||
if len(real_slots) < 3:
|
if len(real_slots) < 3:
|
||||||
real_slots = list(range(board_offset, board_offset + self.ideal_hashboards))
|
real_slots = list(range(board_offset, board_offset + self.ideal_hashboards))
|
||||||
|
|||||||
@@ -303,17 +303,12 @@ class BOSMiner(BaseMiner):
|
|||||||
The config from `self.config`.
|
The config from `self.config`.
|
||||||
"""
|
"""
|
||||||
logging.debug(f"{self}: Getting config.")
|
logging.debug(f"{self}: Getting config.")
|
||||||
conn = None
|
|
||||||
try:
|
try:
|
||||||
conn = await self._get_ssh_connection()
|
conn = await self._get_ssh_connection()
|
||||||
except ConnectionError:
|
except ConnectionError:
|
||||||
try:
|
conn = None
|
||||||
pools = await self.api.pools()
|
|
||||||
except APIError:
|
|
||||||
return self.config
|
|
||||||
if pools:
|
|
||||||
self.config = MinerConfig().from_api(pools["POOLS"])
|
|
||||||
return self.config
|
|
||||||
if conn:
|
if conn:
|
||||||
async with conn:
|
async with conn:
|
||||||
# good ol' BBB compatibility :/
|
# good ol' BBB compatibility :/
|
||||||
@@ -365,6 +360,8 @@ class BOSMiner(BaseMiner):
|
|||||||
async def set_power_limit(self, wattage: int) -> bool:
|
async def set_power_limit(self, wattage: int) -> bool:
|
||||||
try:
|
try:
|
||||||
cfg = await self.get_config()
|
cfg = await self.get_config()
|
||||||
|
if cfg is None:
|
||||||
|
return False
|
||||||
cfg.autotuning_wattage = wattage
|
cfg.autotuning_wattage = wattage
|
||||||
await self.send_config(cfg)
|
await self.send_config(cfg)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "pyasic"
|
name = "pyasic"
|
||||||
version = "0.38.2"
|
version = "0.38.5"
|
||||||
description = "A set of modules for interfacing with many common types of ASIC bitcoin miners, using both their API and SSH."
|
description = "A set of modules for interfacing with many common types of ASIC bitcoin miners, using both their API and SSH."
|
||||||
authors = ["UpstreamData <brett@upstreamdata.ca>"]
|
authors = ["UpstreamData <brett@upstreamdata.ca>"]
|
||||||
repository = "https://github.com/UpstreamData/pyasic"
|
repository = "https://github.com/UpstreamData/pyasic"
|
||||||
|
|||||||
Reference in New Issue
Block a user