Skip to content
This repository was archived by the owner on Feb 14, 2018. It is now read-only.

Fixed hash rate display #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions PiMinerInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ def cg_rpc(self, host, port, command):
return None

def hashrate(self, h):
u = 'Mh/s'
u = 'Gh/s'
if h >= 1000.0:
u = 'Gh/s'
u = 'Th/s'
h = h / 1000.0
elif h >= 1000000.0:
u = 'Th/s'
u = 'Ph/s'
h = h / 1000000.0
s = '%s %s' % ("{0:.5f}".format(h), u)
s = '%s %s' % ("{0:.2f}".format(h), u)
return s

def abbrev(self, v):
Expand Down Expand Up @@ -143,7 +143,7 @@ def parse_summary(self, r):
rej = self.abbrev(d['Rejected'])
hw = self.abbrev(d['Hardware Errors'])
s1 = 'A%s R%s H%s' % (acc, rej, hw)
s2 = 'avg:%s' % self.hashrate(float(d['MHS av']))
s2 = 'avg:%s' % self.hashrate(float(d['GHS av']))
return [s1, s2]
except Exception as e:
return [str(e), str(e)]
Expand Down