fixed small bug with getting pool usernames
This commit is contained in:
@@ -146,7 +146,10 @@ async def get_formatted_data(ip: ipaddress.ip_address):
|
|||||||
th5s = 0
|
th5s = 0
|
||||||
else:
|
else:
|
||||||
th5s = 0
|
th5s = 0
|
||||||
user = data['pools'][0]['POOLS'][0]['User']
|
if not data['pools'][0]['POOLS'] == []:
|
||||||
|
user = data['pools'][0]['POOLS'][0]['User']
|
||||||
|
else:
|
||||||
|
user = "Blank"
|
||||||
return {'TH/s': th5s, 'IP': str(miner.ip), 'host': host, 'user': user, 'wattage': wattage}
|
return {'TH/s': th5s, 'IP': str(miner.ip), 'host': host, 'user': user, 'wattage': wattage}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
10
main.py
10
main.py
@@ -1,6 +1,8 @@
|
|||||||
from network import MinerNetwork
|
from network import MinerNetwork
|
||||||
from miners.bosminer import BOSminer
|
from miners.bosminer import BOSminer
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from API.bosminer import BOSMinerAPI
|
||||||
|
from API.cgminer import CGMinerAPI
|
||||||
|
|
||||||
|
|
||||||
async def good_boards():
|
async def good_boards():
|
||||||
@@ -39,6 +41,12 @@ async def test_command():
|
|||||||
data = await asyncio.gather(tasks)
|
data = await asyncio.gather(tasks)
|
||||||
print(data)
|
print(data)
|
||||||
|
|
||||||
|
async def get_commands_from_miner_api():
|
||||||
|
miner = BOSMinerAPI("192.168.1.1")
|
||||||
|
print(miner.get_commands())
|
||||||
|
miner = CGMinerAPI("192.168.1.1")
|
||||||
|
print(miner.get_commands())
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
asyncio.new_event_loop().run_until_complete(test_command())
|
asyncio.new_event_loop().run_until_complete(get_commands_from_miner_api())
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ from miners.cgminer import CGMiner
|
|||||||
from miners.unknown import UnknownMiner
|
from miners.unknown import UnknownMiner
|
||||||
|
|
||||||
PING_RETRIES: int = 3
|
PING_RETRIES: int = 3
|
||||||
PING_TIMEOUT: int = 1
|
PING_TIMEOUT: int = 3
|
||||||
|
|
||||||
|
|
||||||
class MinerNetwork:
|
class MinerNetwork:
|
||||||
|
|||||||
Reference in New Issue
Block a user