added mac addresses to get_data

This commit is contained in:
UpstreamData
2022-06-03 14:28:59 -06:00
parent 895a5b7ac8
commit d3a71c5a93
18 changed files with 190 additions and 1 deletions

View File

@@ -135,6 +135,7 @@ class BMMiner(BaseMiner):
model = await self.get_model()
hostname = await self.get_hostname()
mac = await self.get_mac()
if model:
data.model = model
@@ -142,6 +143,9 @@ class BMMiner(BaseMiner):
if hostname:
data.hostname = hostname
if mac:
data.mac = mac
miner_data = None
for i in range(DATA_RETRIES):
miner_data = await self.api.multicommand(

View File

@@ -264,6 +264,7 @@ class BOSMiner(BaseMiner):
model = await self.get_model()
hostname = await self.get_hostname()
mac = await self.get_mac()
if model:
data.model = model
@@ -271,6 +272,9 @@ class BOSMiner(BaseMiner):
if hostname:
data.hostname = hostname
if mac:
data.mac = mac
miner_data = None
for i in range(DATA_RETRIES):
try:

View File

@@ -93,18 +93,24 @@ class BTMiner(BaseMiner):
try:
model = await self.get_model()
hostname = await self.get_hostname()
mac = await self.get_mac()
except APIError:
logging.warning(f"Failed to get hostname and model: {self}")
logging.warning(f"Failed to get hostname, mac, and model: {self}")
model = None
data.model = "Whatsminer"
hostname = None
data.hostname = "Whatsminer"
mac = None
if model:
data.model = model
if hostname:
data.hostname = hostname
if mac:
data.mac = mac
miner_data = None
for i in range(DATA_RETRIES):
try:

View File

@@ -113,12 +113,17 @@ class CGMiner(BaseMiner):
model = await self.get_model()
hostname = await self.get_hostname()
mac = await self.get_mac()
if model:
data.model = model
if hostname:
data.hostname = hostname
if mac:
data.mac = mac
miner_data = None
for i in range(DATA_RETRIES):
miner_data = await self.api.multicommand("summary", "pools", "stats")