feature: add is_mining to all miner types.

This commit is contained in:
UpstreamData
2023-06-23 14:38:38 -06:00
parent 7d1a702804
commit f2abe9fd9e
8 changed files with 37 additions and 152 deletions

View File

@@ -318,3 +318,6 @@ class BFGMiner(BaseMiner):
return round(ideal_rate, 2)
except (KeyError, IndexError):
pass
async def is_mining(self, *args, **kwargs) -> Optional[bool]:
return None

View File

@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and -
# limitations under the License. -
# ------------------------------------------------------------------------------
from typing import List
from typing import List, Optional
from pyasic.config import MinerConfig
from pyasic.data import HashBoard
@@ -157,3 +157,6 @@ class BFGMinerGoldshell(BFGMiner):
print(self, api_devdetails)
return hashboards
async def is_mining(self, *args, **kwargs) -> Optional[bool]:
return None

View File

@@ -352,3 +352,6 @@ class BMMiner(BaseMiner):
return round(ideal_rate, 2)
except (KeyError, IndexError):
pass
async def is_mining(self, *args, **kwargs) -> Optional[bool]:
return None

View File

@@ -150,3 +150,6 @@ class BOSMinerOld(BOSMiner):
async def get_data(self, allow_warning: bool = False, **kwargs) -> MinerData:
return MinerData(ip=str(self.ip))
async def is_mining(self, *args, **kwargs) -> Optional[bool]:
return None

View File

@@ -375,3 +375,6 @@ class CGMiner(BaseMiner):
return round(ideal_rate, 2)
except (KeyError, IndexError):
pass
async def is_mining(self, *args, **kwargs) -> Optional[bool]:
return None

View File

@@ -371,3 +371,6 @@ class CGMinerAvalon(CGMiner):
except LookupError:
pass
return False
async def is_mining(self, *args, **kwargs) -> Optional[bool]:
return None

View File

@@ -169,3 +169,6 @@ class VNish(BMMiner):
return fw_ver
except KeyError:
pass
async def is_mining(self, *args, **kwargs) -> Optional[bool]:
return None