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