format: remove random print statements.
This commit is contained in:
@@ -18,6 +18,7 @@ from typing import List, Optional
|
|||||||
from pyasic.config import MinerConfig
|
from pyasic.config import MinerConfig
|
||||||
from pyasic.data import HashBoard
|
from pyasic.data import HashBoard
|
||||||
from pyasic.errors import APIError
|
from pyasic.errors import APIError
|
||||||
|
from pyasic.logger import logger
|
||||||
from pyasic.miners.backends import BFGMiner
|
from pyasic.miners.backends import BFGMiner
|
||||||
from pyasic.web.goldshell import GoldshellWebAPI
|
from pyasic.web.goldshell import GoldshellWebAPI
|
||||||
|
|
||||||
@@ -138,7 +139,7 @@ class BFGMinerGoldshell(BFGMiner):
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
print(self, api_devs)
|
logger.error(self, api_devs)
|
||||||
|
|
||||||
if not api_devdetails:
|
if not api_devdetails:
|
||||||
try:
|
try:
|
||||||
@@ -156,7 +157,7 @@ class BFGMinerGoldshell(BFGMiner):
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
print(self, api_devdetails)
|
logger.error(self, api_devdetails)
|
||||||
|
|
||||||
return hashboards
|
return hashboards
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from pyasic.errors import APIError
|
from pyasic.errors import APIError
|
||||||
|
from pyasic.logger import logger
|
||||||
from pyasic.miners.backends.bmminer import BMMiner
|
from pyasic.miners.backends.bmminer import BMMiner
|
||||||
from pyasic.web.vnish import VNishWebAPI
|
from pyasic.web.vnish import VNishWebAPI
|
||||||
|
|
||||||
@@ -144,7 +145,7 @@ class VNish(BMMiner):
|
|||||||
float(float(api_summary["SUMMARY"][0]["GHS 5s"]) / 1000), 2
|
float(float(api_summary["SUMMARY"][0]["GHS 5s"]) / 1000), 2
|
||||||
)
|
)
|
||||||
except (IndexError, KeyError, ValueError, TypeError) as e:
|
except (IndexError, KeyError, ValueError, TypeError) as e:
|
||||||
print(e)
|
logger.error(e)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def get_wattage_limit(self, web_settings: dict = None) -> Optional[int]:
|
async def get_wattage_limit(self, web_settings: dict = None) -> Optional[int]:
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import asyncssh
|
|||||||
from pyasic.config import MinerConfig
|
from pyasic.config import MinerConfig
|
||||||
from pyasic.data import Fan, HashBoard, MinerData
|
from pyasic.data import Fan, HashBoard, MinerData
|
||||||
from pyasic.data.error_codes import MinerErrorData
|
from pyasic.data.error_codes import MinerErrorData
|
||||||
|
from pyasic.logger import logger
|
||||||
|
|
||||||
|
|
||||||
class BaseMiner(ABC):
|
class BaseMiner(ABC):
|
||||||
@@ -397,7 +398,7 @@ class BaseMiner(ABC):
|
|||||||
if fn_args[arg_name].get("web"):
|
if fn_args[arg_name].get("web"):
|
||||||
web_multicommand.append(fn_args[arg_name]["web"])
|
web_multicommand.append(fn_args[arg_name]["web"])
|
||||||
except KeyError as e:
|
except KeyError as e:
|
||||||
print(e, data_name)
|
logger.error(e, data_name)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
api_multicommand = list(set(api_multicommand))
|
api_multicommand = list(set(api_multicommand))
|
||||||
|
|||||||
@@ -146,8 +146,6 @@ class BOSMinerWebAPI(BaseWebAPI):
|
|||||||
data = await client.get(
|
data = await client.get(
|
||||||
f"http://{self.ip}{path}", headers={"User-Agent": "BTC Tools v0.1"}
|
f"http://{self.ip}{path}", headers={"User-Agent": "BTC Tools v0.1"}
|
||||||
)
|
)
|
||||||
print(data.status_code)
|
|
||||||
print(data.text)
|
|
||||||
if data.status_code == 200:
|
if data.status_code == 200:
|
||||||
return data.json()
|
return data.json()
|
||||||
if ignore_errors:
|
if ignore_errors:
|
||||||
|
|||||||
Reference in New Issue
Block a user