blubat-core 0.4.0

Bluetooth battery model, macOS data sources and polling engine behind the blubat CLI
docs.rs failed to build blubat-core-0.4.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

Core of blubat, a Bluetooth battery monitor for macOS.

This crate owns the device model, the macOS data sources that feed it, the merge that reconciles them, the two tier poller, the rolling history behind the trend and the rate, the threshold event engine and the configuration and JSON shapes. No single macOS source lists every device battery, so readings come from IOKit and from system_profiler and are merged into one view that keeps the source and freshness of each reading visible. Nothing here depends on a terminal library, so the TUI is one frontend over this crate rather than the program itself. For the same reason input a source could not use travels out on the snapshot rather than being printed, leaving a frontend that owns the screen free to place it.

let reading = blubat_core::snapshot();

for device in reading.with_battery() {
    println!("{} {:?}", device.name, device.levels.lowest());
}