added a basis for configuration of X17 and X19 miners by getting pool info from config file.
This commit is contained in:
@@ -76,3 +76,13 @@ SAMPLE CONFIG
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
|
||||
def general_config_convert_pools(config: dict):
|
||||
out_config = {}
|
||||
pools = config.get("pool_groups")
|
||||
if pools:
|
||||
if len(pools) > 0:
|
||||
pools = pools[0]
|
||||
out_config = pools["pools"][:3]
|
||||
return out_config
|
||||
|
||||
@@ -7,6 +7,7 @@ class MinerData:
|
||||
"""A Dataclass to standardize data returned from miners (specifically AnyMiner().get_data())
|
||||
|
||||
:param ip: The IP of the miner as a str.
|
||||
:param datetime: The time and date this data was generated.
|
||||
:param model: The model of the miner as a str.
|
||||
:param hostname: The network hostname of the miner as a str.
|
||||
:param hashrate: The hashrate of the miner in TH/s as a int.
|
||||
|
||||
@@ -4,6 +4,9 @@ from miners._types import S17 # noqa - Ignore access to _module
|
||||
import httpx
|
||||
|
||||
|
||||
# TODO add config
|
||||
|
||||
|
||||
class BMMinerS17(BMMiner, S17):
|
||||
def __init__(self, ip: str) -> None:
|
||||
super().__init__(ip)
|
||||
|
||||
@@ -5,6 +5,9 @@ import httpx
|
||||
import json
|
||||
|
||||
|
||||
# TODO add config
|
||||
|
||||
|
||||
class BMMinerS19(BMMiner, S19):
|
||||
def __init__(self, ip: str) -> None:
|
||||
super().__init__(ip)
|
||||
|
||||
@@ -1,32 +1,26 @@
|
||||
from datetime import datetime, timedelta
|
||||
from io import BytesIO
|
||||
from typing import List, Dict
|
||||
from data import MinerData
|
||||
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
from matplotlib.ticker import MultipleLocator
|
||||
from matplotlib.dates import DateFormatter
|
||||
import numpy as np
|
||||
from reportlab.lib import colors
|
||||
from matplotlib.ticker import MultipleLocator
|
||||
from reportlab.lib.pagesizes import letter, inch
|
||||
from reportlab.lib.styles import (
|
||||
ParagraphStyle,
|
||||
TA_CENTER, # noqa - not declared in __all__
|
||||
)
|
||||
from reportlab.lib.utils import ImageReader
|
||||
from reportlab.platypus import (
|
||||
SimpleDocTemplate,
|
||||
KeepInFrame,
|
||||
Table,
|
||||
Image,
|
||||
Paragraph,
|
||||
TableStyle,
|
||||
PageBreak,
|
||||
Spacer,
|
||||
)
|
||||
from io import BytesIO
|
||||
from svglib.svglib import svg2rlg
|
||||
|
||||
from data import MinerData
|
||||
|
||||
|
||||
async def generate_pdf(data: Dict[str, List[MinerData]], file_loc):
|
||||
doc = SimpleDocTemplate(
|
||||
|
||||
Reference in New Issue
Block a user