Skip to content

Add live battery power rate display#2

Open
git-anish wants to merge 2 commits into
SomeInterestingUserName:mainfrom
git-anish:codex/power-rate-menu
Open

Add live battery power rate display#2
git-anish wants to merge 2 commits into
SomeInterestingUserName:mainfrom
git-anish:codex/power-rate-menu

Conversation

@git-anish
Copy link
Copy Markdown

Summary

This PR extends WhatWatt beyond negotiated adapter wattage and adds live battery charge/discharge power flow in a lightweight menu bar UI.

What changed

  • show live battery charge or discharge rate in watts using AppleSmartBattery current and voltage
  • keep low-power defaults by using event-driven refreshes with a 1s burst for 20s after charger-state changes and a 60s idle refresh otherwise
  • add an Always Live Updates toggle
  • add a lightweight Preferences... window for update tuning
  • handle wrapped signed battery amperage values correctly on Intel Macs
  • use a compact menu bar title format like 67W | ↑18.4W while charging and ↓18.4W when unplugged
  • add a preference to show or hide 0W adapter state when unplugged

Notes

The battery telemetry appears to update on a slower cadence than the timer on some Macs, so 1 Hz refreshes do not always produce visibly new watt values every second. This PR keeps the UI lightweight while still making charger transitions observable.

This work was developed in a public fork here: https://github.com/git-anish/whatwatts

@SomeInterestingUserName
Copy link
Copy Markdown
Owner

Wow this is awesome! I will need some time to review your PR but I appreciate you finding this widget useful enough to make such an extensive contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants