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. A 404 from showlog returns {"available": False} in either mode. With throw_errors off, a 403, HTTP or transport failure, or undecodable JSON from showlog returns None. A failed or missing showstat read leaves average fields unset while preserving the latest result. With throw_errors on, either read raises OPNsenseError on failures other than 404.

Return type:

dict[str, Any] | None

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]