Skip to content

feat: add configurable linear fan speed interpolation - #6

Merged
DF-wu merged 1 commit into
masterfrom
feat/fan-speed-interpolation
Oct 31, 2026
Merged

DF-wu merged 1 commit into
masterfrom
feat/fan-speed-interpolation

Conversation

@DF-wu

@DF-wu DF-wu commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Enable piecewise linear fan-speed interpolation by default, including for existing configurations that omit the new option. For example, between 70°C/45% and 75°C/60%, 72°C now requests 51% instead of the legacy 45% step.

  • Add FAN_SPEED_INTERPOLATION=true; false runs the original stepwise selection and downshift-only HYSTERESIS unchanged.
  • Interpolate between the four existing low/medium/high/critical anchors and ceil to integer duty. Below low uses idle; at/above critical clamps to critical duty. Distinct idle/low speeds intentionally jump at the low threshold, with no invented idle-temperature anchor.
  • Ignore level hysteresis in interpolation mode in both directions. Each cycle follows current demand, including upward changes within a level; unchanged integer duty avoids redundant commands. Sensor maximum/offset handling, implausible-reading filtering, failsafe recovery, and manual/restore protections retain their existing paths.
  • Expose the switch and its semantics in validation, effective config, read-only diagnostics, the Compose env-file workflow, the TUI, and English/Traditional Chinese docs. Align the example/documented idle default with the source's existing 30% default.

Validation:

  • make test: 116 controller assertions and 22 TUI assertions passed, plus Bash syntax checks. Covers default/disabled behavior, anchors, endpoints, bounds, monotonicity, uneven segments and ceiling, invalid boolean, prior levels/hysteresis, actual cycle state updates, command failure, failsafe recovery, diagnostics, and TUI round trips.
  • make validate-example: passed with dry-run configuration.
  • docker compose config --format json: passed using temporary example configuration for both true and false; verified the container environment preserves each value.
  • git diff --check: passed; reviewed the final diff locally.

Hardware I/O is stubbed in tests. No live fan, iDRAC, ESXi, TrueNAS, or service access was performed. Independent review of ec8e34e..c048689 found no substantive regressions. It independently passed 115 controller assertions (omitting the filesystem-writing healthcheck), 441 disabled-mode comparisons against the pinned legacy implementation, and 294 interpolation comparisons confirming independence from prior level/hysteresis, plus syntax and whitespace checks. The reviewer could not rerun full make test or TUI round trips because its /tmp was read-only; the complete parent-run results are listed above.

Enable piecewise interpolation between existing temperature anchors by default, rounding duty up without level hysteresis. Preserve the original stepwise downshift hysteresis when disabled, and expose the option in config, diagnostics, Compose, TUI, tests, and operational docs.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-31T18:38:28.664669Z c048689 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@DF-wu

DF-wu commented Oct 31, 2026

Copy link
Copy Markdown
Owner Author

@Catalina-df review. if everything ok then merge.

@DF-wu
DF-wu merged commit 5aee2b9 into master Oct 31, 2026
2 checks passed
@Catalina-df

Copy link
Copy Markdown
Contributor

In reply to #6 (comment):

Catalina 翻開變更紀錄,逐項核對。

「我會檢查 PR 的最新差異、測試與合併狀態,並依 coding-agent、code-review 技能進行審查;若沒有需要修正的問題,就依您的授權合併。」

Catalina 將審查範圍記在一旁。

「PR 目前可合併,CI 測試已通過,最新提交仍是 c048689。我會以 ec8e34e..c048689 為範圍,平行檢查程式慣例與需求符合度,並在隔離工作目錄重跑測試。」

Catalina 核對測試結果後,繼續翻查控制循環。

「本次重跑通過了 116 項控制器斷言、22 項 TUI 斷言,語法檢查、範例驗證與差異空白檢查也通過;程式慣例審查未發現實質問題。此環境沒有 Docker,Compose 部分先採信 PR 的既有驗證與通過的 CI。

另查到目前 gh 帳號只有此儲存庫的讀取權限;完成需求審查後,我會嘗試授權的合併操作,若遭拒絕會明確回報。」

Catalina 將追蹤筆記與這次的 GitHub 指示對照。

「既有追蹤仍記錄『等待建立 PR』,我會依目前已開啟的 PR 更新。您這次也已明確授權『審查無誤就合併』;合併後會觸發儲存庫既有的映像建置流程,本次不會操作任何主機或風扇服務。」

Catalina 核對合併回覆,再查看 GitHub 狀態。

「兩個審查面向均未發現需要修正的問題。gh 的合併因帳號權限遭拒,但既有 MetaMCP GitHub 連線已成功將 PR squash 合併為 5aee2b9;我正在確認最終狀態並更新追蹤紀錄。」

Catalina 合上審查紀錄,將結果呈上。

「審查未發現需要修正的問題,PR #6 已 squash 合併至 master。」

合併提交: 5aee2b9 — feat: add configurable linear fan speed interpolation (#6)。已確認 GitHub 狀態為 MERGED,且 master 指向該提交。

本次檢查 ec8e34e..c048689 的完整差異,兩個審查面向均通過:

審查面向 結果
程式慣例 未發現實質違規或需要調整的結構問題。
需求與行為 插值、向上取整、端點、舊設定預設值及停用後的階梯/遲滯行為符合規格;安全路徑與設定介面保持一致。

本次重新執行的驗證:

  • make test:116 項控制器斷言、22 項 TUI 斷言及 Bash 語法檢查通過。
  • make validate-example、git diff --check:通過。
  • 合併前 CI:通過。

此環境未安裝 Docker,因此未重跑 Compose 驗證;該部分依據 PR 既有驗證與通過的 CI。本次測試使用硬體 stub,未操作實際風扇、iDRAC、ESXi、TrueNAS 或部署服務。

Catalina 將合併紀錄收妥。

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.

2 participants