Skip to content

Legion Go fans support#104

Merged
honjow merged 4 commits into
mainfrom
go_fans
Mar 19, 2026
Merged

Legion Go fans support#104
honjow merged 4 commits into
mainfrom
go_fans

Conversation

@honjow

@honjow honjow commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

honjow added 4 commits March 19, 2026 04:20
Support the lenovo-legion-go-wmi-fan kernel driver which exposes fan
curve control through hwmon with non-standard constraints:
- Temperature points are firmware-fixed (read-only, 10-100°C in 10°C steps)
- Fan RPM cannot be read (no fan1_input)
- Only PWM curve values (pwm1_auto_point{1-10}_pwm) are writable

Backend changes (fan.py):
- Add fixed_temps field to FanConfig for firmware-imposed temperature points
- Make pwm_input optional in hwmon config parsing (no fan RPM on some hardware)
- Make temp_write optional in curve_path (skip writes when temp is read-only)
- Skip temp file writes in set_fanAuto, set_fanPercent, set_fanCurve when None
- Add _interpolate_to_fixed_temps() to map arbitrary user curves to fixed points
- Return fan_fixed_temps in get_fanConfigList for frontend use

Schema changes (hwmon.json):
- Make temp_write optional in PWMWriteCurvePath (required -> only pwm_write)
- Make PWMInput fields optional (for devices without RPM reading)
- Add fixed_temps array field to PWMWrite definition

Frontend changes:
- Add fan_fixed_temps to FanConfig type and getFanFixedTemps() to BackendData
- Curve editor: lock temperature axis when fixedTemps is set (vertical drag only)
- Curve editor: disable temperature slider for fixed-temp devices
- Curve editor: draw orange dashed guide lines at fixed temperature positions
- Pass fixedTemps prop through FANManageProfileComponent to modal dialogs

New config: legion_wmi_fan.yml with MIN_CURVE defaults from firmware
- Show target speed percentage instead of "0 RPM" when hardware
  does not support RPM reading (e.g. legion_wmi_fan)
- Fix NaN from division by zero when max RPM is 0
@honjow
honjow merged commit 020b474 into main Mar 19, 2026
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.

1 participant