added unknown miner type
This commit is contained in:
@@ -7,4 +7,4 @@ import ipaddress
|
||||
class BaseMiner:
|
||||
def __init__(self, ip: str, api: BOSMinerAPI or CGMinerAPI or BMMinerAPI):
|
||||
self.ip = ipaddress.ip_address(ip)
|
||||
self.api = api
|
||||
self.api = api
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from miners.bosminer import BOSminer
|
||||
from miners.bmminer import BMMiner
|
||||
from miners.cgminer import CGMiner
|
||||
from miners.unknown_miner import UnknownMiner
|
||||
from API import APIError
|
||||
import asyncio
|
||||
import ipaddress
|
||||
@@ -19,7 +20,7 @@ class MinerFactory:
|
||||
return CGMiner(str(ip))
|
||||
elif version == "BMMiner":
|
||||
return BMMiner(str(ip))
|
||||
return f"Unknown: {str(ip)}"
|
||||
return UnknownMiner(str(ip))
|
||||
|
||||
async def _get_version_data(self, ip: ipaddress.ip_address):
|
||||
try:
|
||||
|
||||
9
miners/unknown_miner.py
Normal file
9
miners/unknown_miner.py
Normal file
@@ -0,0 +1,9 @@
|
||||
import ipaddress
|
||||
|
||||
|
||||
class UnknownMiner():
|
||||
def __init__(self, ip: str):
|
||||
self.ip = ipaddress.ip_address(ip)
|
||||
|
||||
def __repr__(self):
|
||||
return f"Unknown: {str(self.ip)}"
|
||||
Reference in New Issue
Block a user