Skip to content

Keep fans when closed on AC power#12

Open
nsd97 wants to merge 1 commit into
idevtim:mainfrom
nsd97:contrib/keep-fans-closed-on-power
Open

Keep fans when closed on AC power#12
nsd97 wants to merge 1 commit into
idevtim:mainfrom
nsd97:contrib/keep-fans-closed-on-power

Conversation

@nsd97

@nsd97 nsd97 commented Jul 19, 2026

Copy link
Copy Markdown

What does this PR do?

Adds Keep Fans When Closed on Power (default off): on AC, leave fans under app control through display sleep / lock / willSleep so lid-close clamshell does not force fans back to auto.

Closes #11.

Context

  • Issue: Proposal: Keep fans when closed on AC power #11
  • Stack: standalone (no dependency on other open PRs)
  • Out of scope: keeping the Mac awake (pmset / private clamshell SPI), battery lid-close beyond existing Keep Fans on Screen Sleep, Ultra / helper changes

What changed

  • DisplaySleepFanPolicykeepClosedOnPower && onAC → keep; else fall back to keepOnScreenSleep
  • PowerSource.isOnAC via IOPS
  • FanMonitor uses the same policy for screen sleep, screen lock, and willSleep (lid close often posts willSleep after screensDidSleep; resetting there was undoing keep)
  • Settings → Fan Control → Keep Fans When Closed on Power
  • Diagnostics export includes the new setting

Review guide

Start at: ChillMac/Fan/DisplaySleepFanPolicy.swiftChillMac/Fan/FanMonitor.swift (handleSleep / handleScreenSleep / handleScreenLocked) → ChillMac/Views/SettingsView.swift (Fan Control row)

How to test

  1. xcodegen generate && xcodebuild -project ChillMac.xcodeproj -scheme ChillMac build
  2. Plug in AC → enable Performance Mode → Settings → Fan Control → turn Keep Fans When Closed on Power on
  3. Close lid in clamshell (external display / awake) → fans should stay under app control (not snap to auto)
  4. On battery with the new toggle on (and Keep Fans on Screen Sleep off) → lid close should still reset
  5. Both keep toggles off → sleep / lid close still resets (unchanged)

Checklist

  • Builds without errors (xcodegen generate && xcodebuild -scheme ChillMac build)
  • Unit tests pass — N/A on current main (no test target yet; policy is pure and covered on the fork harness)
  • Tested manually in the app

Made with Cursor

Honor Keep Fans When Closed on Power for willSleep so lid close does not force fans back to auto after a keep decision.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

Proposal: Keep fans when closed on AC power

1 participant