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

@@ -23,6 +23,19 @@ class BMMinerS19a(BMMiner, S19a):
hostname = data["hostname"]
return hostname
async def get_mac(self):
mac = None
url = f"http://{self.ip}/cgi-bin/get_system_info.cgi"
auth = httpx.DigestAuth("root", "root")
async with httpx.AsyncClient() as client:
data = await client.get(url, auth=auth)
if data.status_code == 200:
data = data.json()
if len(data.keys()) > 0:
if "macaddr" in data.keys():
mac = data["macaddr"]
return mac
async def fault_light_on(self) -> bool:
url = f"http://{self.ip}/cgi-bin/blink.cgi"
auth = httpx.DigestAuth("root", "root")