add getting mac for whatsminers

This commit is contained in:
UpstreamData
2022-05-16 15:00:52 -06:00
parent e091863aa7
commit 40bacbf41c
3 changed files with 12 additions and 1 deletions

View File

@@ -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),

View File

@@ -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),

View File

@@ -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))