Skip to main content

Module runtime_env

Module runtime_env 

Source
Expand description

Provides best-effort checks of system conditions to determine when uploads should be deferred.

Reads /sys/class/power_supply to detect battery state and parses NetworkManager D-Bus properties to identify metered connections. All checks are non-fatal: if a sysfs path is missing or D-Bus is unavailable, the condition is assumed to be clear.

Functionsยง

is_metered_connection
Returns true if the current primary network connection is metered.
is_metered_connection_from_nmcli_output ๐Ÿ”’
Check if the nmcli output string indicates a metered network connection.
is_on_battery_power
Returns true if the system appears to be running on battery power.
is_on_battery_power_from_statuses ๐Ÿ”’
Determine if running on battery based on parsed power supply types and online statuses.