重构IPMI风扇控制工具 添加配置化管理和跨平台支持 #2
Open
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()