add getting mac for whatsminers
This commit is contained in:
@@ -83,6 +83,9 @@ class BaseMiner:
|
||||
async def send_config(self, *args, **kwargs):
|
||||
return None
|
||||
|
||||
async def get_mac(self):
|
||||
return None
|
||||
|
||||
async def get_data(self):
|
||||
data = {
|
||||
"IP": str(self.ip),
|
||||
|
||||
@@ -72,6 +72,15 @@ class BTMiner(BaseMiner):
|
||||
logging.debug(f"Found board data for {self}: {boards}")
|
||||
return boards
|
||||
|
||||
async def get_mac(self):
|
||||
mac = ""
|
||||
data = await self.api.get_miner_info()
|
||||
if data:
|
||||
if "Msg" in data.keys():
|
||||
if "mac" in data["Msg"].keys():
|
||||
mac = data["Msg"]["mac"]
|
||||
return str(mac).upper()
|
||||
|
||||
async def get_data(self):
|
||||
data = {
|
||||
"IP": str(self.ip),
|
||||
|
||||
@@ -252,7 +252,6 @@ class MinerFactory(metaclass=Singleton):
|
||||
miner = CGMiner(str(ip))
|
||||
elif "BTMiner" in api:
|
||||
miner = BTMiner(str(ip))
|
||||
print(miner)
|
||||
elif "BMMiner" in api:
|
||||
miner = BMMiner(str(ip))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user