Firmware
- static OPNsenseClient.get_firmware_requirements()
Return the Minimum Firmware and Recommended Firmware that aiopnsense supports.
This reads library constants and never contacts a Router. It can be called on the class, such as
OPNsenseClient.get_firmware_requirements(), before any client exists, for example from a config flow.- Returns:
Minimum Firmware and Recommended Firmware versions.
- Return type:
- async OPNsenseClient.get_host_firmware_version()
Return the cached OPNsense firmware version.
- Returns:
- Installed firmware version, falling back to the product
series for non-SemVer version strings, or
Nonewhen the firmware status endpoint is unavailable.
- Return type:
None | str
- async OPNsenseClient.get_firmware_update_info(*, check_for_updates=True)
Return firmware status and trigger a refresh when cached data is stale.
One client requests at most one acknowledged automatic check per hour, even when the status still needs a refresh. Dispatching a firmware update or upgrade, through
install_firmwareor the deprecatedupgrade_firmware, ends the cooldown so the next call can refresh the installed state.OPNsense removes the build number from
product_latest. When anopnsense-develupdate is available,product_latestis replaced with that package’s new version so callers receive the exact build.- Parameters:
check_for_updates (bool) – Allow automatic refresh checks when idle. Disable for strictly read-only firmware status requests.
- Returns:
- Firmware status payload from OPNsense,
including product version, latest version, check status, and update metadata when available. Returns an empty mapping when the firmware status endpoint is unavailable.
- Return type:
MutableMapping[str, Any]
- async OPNsenseClient.install_firmware(type='update', *, target_version, timeout=1800, poll_interval=5)
Install firmware and verify completion, including server-managed reboot.
The action is dispatched exactly once. Transport ambiguity never causes a retry. A new action log, terminal state, idle server and installed target version must agree before this method returns. Rebooting updates additionally require an observed outage followed by reconnection. Dispatch ends the automatic check cooldown, whatever the outcome.
- Parameters:
type (str) –
updatefor a minor update orupgradefor a major one.target_version (str) – Expected firmware version (including hotfix revision). A beta target must include its build number.
timeout (float) – Overall deadline in seconds, including waiting for idle.
poll_interval (float) – Delay in seconds between status observations.
- Raises:
OPNsenseInvalidArgument – Invalid action, target or timing argument.
OPNsenseError – Concurrent install, rejected dispatch, failed/unconfirmed update, or deadline exceeded. Errors propagate regardless of
throw_errors. Cancellation releases local state and never cancels or reboots the server’s firmware process.
- Return type:
None
- async OPNsenseClient.upgrade_firmware(type='update')
Deprecated
Use install_firmware(target_version=…) to install firmware and verify completion.
Trigger a firmware upgrade without waiting for installation to complete.
Deprecated: use
install_firmware(target_version=...)to install firmware and verify completion.- Parameters:
type (str) – Firmware action to trigger.
updateapplies minor updates on the current series, whileupgradestarts a major series upgrade.- Returns:
- Firmware action response for
supported action types, or
Nonewhentypeis notupdateorupgrade.
- Return type:
MutableMapping[str, Any] | None
- Raises:
OPNsenseError – A firmware installation is already active when
_throw_errorsis enabled.
- async OPNsenseClient.upgrade_status()
Return the status of the active firmware upgrade.
- Returns:
- Upgrade status payload, or an empty
mapping when the upgrade-status endpoint is unavailable.
- Return type:
MutableMapping[str, Any]
- async OPNsenseClient.firmware_changelog(version)
Return the changelog for the firmware upgrade.