Browse Source

Fix Discovery bug when frequency can't be convert to a float

tags/0.0.5
Ryan Joseph 1 year ago
parent
commit
a95d5a6b8e
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      lib/rpjios/Util.py

+ 6
- 1
lib/rpjios/Util.py View File

@@ -56,7 +56,12 @@ def _gather_wifi(iface):
ta.append(g[gk])
g[gk] = Popen(ta, stdout=PIPE).communicate()[0].strip()
if gk == 'freq':
g[gk] = "{0:.2f} GHz".format(float(g[gk]) / 1e9)
fmtFreq = '??'
try:
fmtFreq = "{0:.2f}".format(float(g[gk]) / 1e9)
except:
pass
g[gk] = "{} GHz".format(fmtFreq)
c2 = ["Bit Rate", "Tx-Power", "Link Quality", "Signal level"]
c2d = {}
for cl in Popen(['/sbin/iwconfig', iface], stdout=PIPE).communicate()[0].split('\n'):


Loading…
Cancel
Save