pools: MinerData
This commit is contained in:
@@ -29,6 +29,7 @@ from .device import DeviceInfo
|
|||||||
from .error_codes import BraiinsOSError, InnosiliconError, WhatsminerError, X19Error
|
from .error_codes import BraiinsOSError, InnosiliconError, WhatsminerError, X19Error
|
||||||
from .fans import Fan
|
from .fans import Fan
|
||||||
from .hashrate import AlgoHashRate, HashUnit
|
from .hashrate import AlgoHashRate, HashUnit
|
||||||
|
from pyasic.data.pools import PoolMetrics
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
@@ -71,6 +72,7 @@ class MinerData:
|
|||||||
fault_light: Whether the fault light is on as a boolean.
|
fault_light: Whether the fault light is on as a boolean.
|
||||||
efficiency: Efficiency of the miner in J/TH (Watts per TH/s). Calculated automatically.
|
efficiency: Efficiency of the miner in J/TH (Watts per TH/s). Calculated automatically.
|
||||||
is_mining: Whether the miner is mining.
|
is_mining: Whether the miner is mining.
|
||||||
|
pools: A list of PoolMetrics instances, each representing metrics for a pool.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# general
|
# general
|
||||||
@@ -143,6 +145,9 @@ class MinerData:
|
|||||||
uptime: int = None
|
uptime: int = None
|
||||||
efficiency: int = field(init=False)
|
efficiency: int = field(init=False)
|
||||||
|
|
||||||
|
# pools
|
||||||
|
pools: list[PoolMetrics] = field(default_factory=list)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def fields(cls):
|
def fields(cls):
|
||||||
return [f.name for f in fields(cls) if not f.name.startswith("_")]
|
return [f.name for f in fields(cls) if not f.name.startswith("_")]
|
||||||
|
|||||||
Reference in New Issue
Block a user