Speedtest

async OPNsenseClient.get_speedtest()

Return the latest and average Speedtest result summaries.

Returns:

Mapping with available plus last and

average sections for download, upload, and latency. Latest results include server, date, and URL metadata; averages include min, max, sample count, and period bounds. Returns {"available": False} when show-log is absent (404 in either mode), or on 403/transient HTTP or transport failures with throw_errors off. Those failures raise OPNsenseError when enabled. Undecodable JSON returns None when errors are disabled and raises OPNsenseError otherwise.

Return type:

dict[str, Any]

async OPNsenseClient.run_speedtest()

Start a Speedtest run and return the raw run response.

Returns:

Response mapping from the Speedtest run

endpoint, or an empty mapping when the availability check finds the endpoint absent (404 in either mode), or a 403/transient HTTP or transport failure with throw_errors off. Those failures raise OPNsenseError when enabled. The run request is ungated, so its HTTP/transport failures, including 404, raise OPNsenseError when enabled and return an empty mapping otherwise. Non-mapping JSON also returns an empty mapping. Undecodable JSON returns None when errors are disabled and raises OPNsenseError otherwise.

Return type:

dict[str, Any]