Reading log entries made by a Private Framework for Battery widgets in Sonoma, it’s possible to track information about keyboards, mice, trackpads, UPS and internal batteries.
BatteryCenter
Digging for buried treasure in the Unified log isn’t easy, but has a fine track history of bringing plenty of silver and gold. Here it’s about batteries.
Using a combination of iohid and BatteryCenter, macOS checks attached UPS and wireless keyboards, mice and trackpads ever 2-5 seconds.
