changeset 6:671e66da2cb9

Fix check for modem being connected. Fix cut & paste error making the line rates 1/10th what they should be.
author Daniel O'Connor <darius@dons.net.au>
date Sat, 08 Feb 2014 09:19:20 +1030
parents 072489c80c51
children 98d351a87043
files adslstats.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/adslstats.py	Fri Feb 07 20:36:13 2014 +1030
+++ b/adslstats.py	Sat Feb 08 09:19:20 2014 +1030
@@ -106,7 +106,7 @@
     stats = ADSLStats()
     
     # Check if the modem is offline
-    if a[3].td.contents[0] != 'Up':
+    if a[3].td.findNext('td').contents[0] != 'Up':
 	return None
 
     # dB
@@ -115,8 +115,8 @@
     stats.attendown = float(a[9].td.findNext('td').contents[0]) / 10.0
     stats.attenup = float(a[9].td.findNext('td').findNext('td').contents[0]) / 10.0
     # kBit
-    stats.upstream = float(a[14].td.findNext('td').contents[0]) / 10.0
-    stats.downstream = float(a[14].td.findNext('td').findNext('td').contents[0]) / 10.0
+    stats.upstream = float(a[14].td.findNext('td').contents[0])
+    stats.downstream = float(a[14].td.findNext('td').findNext('td').contents[0])
 
     return stats