Open
Conversation
- 修复损坏的requirements.txt文件编码问题 - 添加JSON配置文件支持 外化所有硬编码设置 - 实现跨平台支持 自动检测Windows/Linux环境 - 添加完善的错误处理和重试机制 - 实现专业的日志系统替代简单print - 支持自定义温度阈值和风扇转速策略 - 添加命令行参数支持和测试模式 - 完善文档 包含详细安装和使用说明 - 添加.gitignore保护敏感配置信息 Co-Authored-By: William Wu <993761206@qq.com>
Owner
Author
|
哈喽 |
- 新增use_fan_curve配置选项支持平滑风扇曲线 - 实现线性插值算法在温度点之间平滑过渡 - 添加fan_curve_points配置支持自定义曲线控制点 - 保持向后兼容 支持传统阶梯模式和新曲线模式 - 更新示例配置展示游戏本风格的风扇曲线 - 完善文档说明两种模式的使用方法 Co-Authored-By: William Wu <993761206@qq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
重构IPMI风扇控制工具 添加配置化管理和跨平台支持
Summary
This PR completely transforms the IPMI fan control script from a basic procedural approach to a professional, configurable tool with smooth fan curve functionality. The changes address all major issues in the original codebase:
🔧 Core Infrastructure:
requirements.txt(was binary encoded, now clean)IPMIFanController🎮 Smart Fan Control:
🛡️ Reliability & Monitoring:
Review & Testing Checklist for Human
os.popen()tosubprocess.run()doesn't break the core raw IPMI commands (0x30 0x30 0x01 0x00, etc.)Recommended Test Sequence:
config.example.json→config.jsonwith real server detailspython main.py --testto verify connectivity and temperature readingDiagram
%%{ init : { "theme" : "default" }}%% graph TD main["main.py<br/>(Entry Point)<br/>IPMIFanController"]:::major-edit config_py["config.py<br/>(Config Management)"]:::major-edit config_example["config.example.json<br/>(Sample Config)"]:::major-edit config_user["config.json<br/>(User Config)"]:::context requirements["requirements.txt<br/>(Fixed Dependencies)"]:::major-edit readme["README.md<br/>(Documentation)"]:::major-edit gitignore[".gitignore<br/>(Security)"]:::minor-edit ipmi_tools["ipmi/<br/>(ipmitool binaries)"]:::context main -->|"loads config"| config_py config_py -->|"reads"| config_user config_example -.->|"template for"| config_user main -->|"executes"| ipmi_tools main -->|"fan curve<br/>interpolation"| main subgraph Legend L1["Major Edit"]:::major-edit L2["Minor Edit"]:::minor-edit L3["Context/No Edit"]:::context end classDef major-edit fill:#90EE90 classDef minor-edit fill:#87CEEB classDef context fill:#FFFFFFNotes
config.jsonbefore the tool can run (no more hardcoded values)speed = point1_speed + (speed_range × temp_offset / temp_range).gitignoreto prevent accidental commit of IPMI credentialsos.popen()tosubprocess.run()