Skip to content

Commit

Permalink
Convert speedtest data to bps (#394)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaskivskyi authored Nov 21, 2023
1 parent 4678238 commit d35b92b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion asusrouter/modules/endpoint/hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,14 @@ def process_speedtest(data: dict[str, Any]) -> dict[str, Any]:

# Rename servers list
if "download" in speedtest:
speedtest["download"]["server_list"] = speedtest["download"].pop("servers", None)
speedtest["download"]["server_list"] = speedtest["download"].pop(
"servers", None
)

# convert bandwidth from Bps to bps
for speed in ("download", "upload"):
if speed in speedtest:
speedtest[speed]["bandwidth"] = 8 * speedtest[speed].get("bandwidth", 0)

# Remove extra values
speedtest.pop("type", None)
Expand Down

0 comments on commit d35b92b

Please sign in to comment.