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.