How buglyz/ecc works
ECC Fan Controller is a Windows laptop fan-control application. The main workflow is: a user edits a curve or mode in the local web console; the dashboard applies and saves configuration; the controller samples CPU/GPU temperatures, combines and smooths them, interpolates a target speed, then conditionally writes both fan registers and records monitoring history. The application also exposes RPM feedback, named presets, startup-task management, and tray status/alerts. README documents these capabilities; some subsystem links below rely on documentation because their implementation was not sampled.
Main entry points: controller.go Fan controller · handlers.go API handlers · main.go Application entry · dashboard HTTP dashboard
Components 19
Application
- Application entry
cmd/fan-controller/main.go - Configuration
internal/config - Startup tasks
internal/startup/startup.go - System tray
internal/tray
Web Console
- HTTP dashboard
internal/dashboard - Web UI
internal/dashboard/web/index.html - API handlers
internal/dashboard/handlers.go
Control Loop
- Fan controller
internal/controller/controller.go - Temperature and curve logic
internal/controller/logic.go - Monitoring history
internal/controller/history.go
Hardware I/O
- Temperature reader
internal/sensors/powershell.go - EC writer
internal/ec/writer.go - EC RPM reader
internal/ec/reader.go
Other components
- User
- Browser
- Windows Task Scheduler
- PowerShell and LHM
- ec-probe
assets/ec-probe.exe - Embedded Controller
Connections 26
- User → Browser: edits settings
- Browser → HTTP dashboard: requests console
- HTTP dashboard → Web UI: serves page
- HTTP dashboard → API handlers: dispatches API
- API handlers → Fan controller: updates mode
- API handlers → Configuration: saves settings
- API handlers → Fan controller: reads status
- API handlers → Startup tasks: manages startup
- Startup tasks → Windows Task Scheduler: runs commands
- Application entry → Configuration: loads configuration
- Application entry → Fan controller: creates and starts
- Application entry → HTTP dashboard: starts server
- Application entry → System tray: starts tray
- Fan controller → Temperature reader: reads temperatures
- Temperature reader → PowerShell and LHM: requests readings
- PowerShell and LHM → Temperature reader: returns temperatures
- Fan controller → Temperature and curve logic: combines and interpolates
- Fan controller → EC writer: writes fan speed
- Fan controller → EC RPM reader: reads fan RPM
- EC writer → ec-probe: invokes write
- EC RPM reader → ec-probe: invokes read
- ec-probe → Embedded Controller: accesses registers
- Fan controller → Monitoring history: records samples
- API handlers → Monitoring history: requests history
- Fan controller → System tray: signals write failure
- System tray → Browser: opens console