Skip to content

Commit

Permalink
consistent naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Tafkas committed Jun 4, 2015
1 parent 2bd15e8 commit 4db75d0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions fritzbox_traffic.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@

def print_values():
try:
con = FritzConnection()
conn = FritzConnection()
except Exception as e:
sys.exit("Couldn't get WAN traffic")

down_traffic = con.call_action('WANCommonInterfaceConfig', 'GetTotalBytesReceived')['NewTotalBytesReceived']
down_traffic = conn.call_action('WANCommonInterfaceConfig', 'GetTotalBytesReceived')['NewTotalBytesReceived']
print ('down.value %d' % down_traffic)

up_traffic = con.call_action('WANCommonInterfaceConfig', 'GetTotalBytesSent')['NewTotalBytesSent']
up_traffic = conn.call_action('WANCommonInterfaceConfig', 'GetTotalBytesSent')['NewTotalBytesSent']
print ('up.value %d' % up_traffic)

max_down_traffic = con.call_action('WANCommonInterfaceConfig', 'GetCommonLinkProperties')[
max_down_traffic = conn.call_action('WANCommonInterfaceConfig', 'GetCommonLinkProperties')[
'NewLayer1DownstreamMaxBitRate']
print ('maxdown.value %d' % max_down_traffic)

max_up_traffic = con.call_action('WANCommonInterfaceConfig', 'GetCommonLinkProperties')[
max_up_traffic = conn.call_action('WANCommonInterfaceConfig', 'GetCommonLinkProperties')[
'NewLayer1UpstreamMaxBitRate']
print ('maxup.value %d' % max_up_traffic)

Expand Down
4 changes: 2 additions & 2 deletions fritzbox_uptime.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@

def print_values():
try:
connection = FritzConnection()
conn = FritzConnection()
except Exception as e:
sys.exit("Couldn't get connection uptime")

uptime = connection.call_action('WANIPConnection', 'GetStatusInfo')['NewUptime']
uptime = conn.call_action('WANIPConnection', 'GetStatusInfo')['NewUptime']
print ('uptime.value %.2f' % (int(uptime) / 86400.0))


Expand Down

0 comments on commit 4db75d0

Please sign in to comment.