From 2dabb02c2c1b8c7c97c71b80c58a7f527b88a116 Mon Sep 17 00:00:00 2001 From: Christian Stade-Schuldt Date: Mon, 29 Mar 2021 19:36:20 +0200 Subject: [PATCH] remove f-strings and one minor bug --- fritzbox_helper.py | 2 +- fritzbox_traffic.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/fritzbox_helper.py b/fritzbox_helper.py index a607541..3661382 100755 --- a/fritzbox_helper.py +++ b/fritzbox_helper.py @@ -90,7 +90,7 @@ def calculate_pbkdf2_response(challenge, password): # Once with dynamic salt. hash1 = hashlib.pbkdf2_hmac("sha256", password.encode(), salt1, iter1) hash2 = hashlib.pbkdf2_hmac("sha256", hash1, salt2, iter2) - return f"{challenge_parts[4]}${hash2.hex()}" + return "{}${}".format(challenge_parts[4], hash2.hex()) def calculate_md5_response(challenge, password): diff --git a/fritzbox_traffic.py b/fritzbox_traffic.py index bb81184..81468c8 100755 --- a/fritzbox_traffic.py +++ b/fritzbox_traffic.py @@ -36,11 +36,10 @@ def print_values(): except Exception as e: sys.exit("Couldn't get WAN traffic") - traffic = fs.transmission_rate - down_traffic = traffic[1] + down_traffic = fs.bytes_received print("down.value %d" % down_traffic) - up_traffic = traffic[0] + up_traffic = fs.bytes_received print("up.value %d" % up_traffic) if not os.environ.get("traffic_remove_max"):