Skip to content

修复风扇 AUTO 读温连续性和 WebUI 状态显示 - #70

Merged
massif-01 merged 3 commits into
RMinte:mainfrom
massif-01:fix/fan-control-065
Nov 16, 2026
Merged

massif-01 merged 3 commits into
RMinte:mainfrom
massif-01:fix/fan-control-065

Conversation

@massif-01

@massif-01 massif-01 commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

风扇控制

  • 智能模式直接使用当前绑定的温度变量。短时读不到时保持最后一次确认的输出。普通智能模式从最后一份有效报告起满 6 秒仍无有效读数,按既定策略回退到 25%。
  • 温源锁忙、变量表锁忙和读数在读取期间更新分别处理。重复读到同一份报告不会续期,也不会当作新样本。
  • 已进入 95°C 高温保护时,断读仍请求 100%。解除需要当前绑定变量确认连续 30 秒不超过 90°C,换绑前的旧读数不能完成解除。重新启用智能模式时,仍有效的绑定温度可用于恢复输出。
  • 沿用基础曲线、普通输出上下限、既定调速规则和手动/曲线模式的温度来源。

风扇 WebUI

  • 调速滑块只在启用的手动模式显示。输出使用卡片的大号百分比,有效温度移到状态行右侧。智能读数靠近模式按钮,保留现有 TTI 帮助。
  • 分开处理拖动草稿、请求值和设备确认输出。旧回包无法在确认切换后重新打开手动滑块。模式切换等待期间,同一风扇的按钮显示暂不可用。设备已切换但保存失败时提示重启后可能恢复旧模式。
  • 单台风扇调速超时只影响该台的输出确认。实时刷新保留正在拖动的滑块,并更新其他卡片。单风扇保留已确认的桌面及手机布局,双风扇切换模式时窗口高度稳定。

验证

  • 在相同源码上重跑风扇监控、驱动/API、输出显示和控制轨迹回归。27 个离线场景的轨迹与本次网页返修前逐字节一致。
  • Chrome 和 WebKit 分别通过 144 项模拟接口检查,覆盖源网页、打包网页、中英文、320/390 px 手机宽度和多风扇交叉时序。单风扇样机完成应用和 WWW 刷写与服务启动确认。
  • 同步配置迁移测试替身的温度读取签名,保留加权温度与部分缺读断言。
  • 独立分支通过本地发布策略、串口包、静态网页和风扇回归。公开发布以 GitHub 上 PR 检查和 main 构建为准。

发布

保留 version.txt 和 Release 名称 v0.6.5。合并后的 main 工作流生成新的 0.6.5+ 构建标识,通过 CI Gate 后更新现有 Release 的固件、WWW 和串口包。发布验证通过后,仅在现有 Release 正文末尾追加本次变更。

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T14:32:35.995280Z 179c08b New commits
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d7dc7de9db

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +717 to +719
if (s_state.bound_var_count == 1) {
double value;
esp_err_t ret = read_fresh_variable_float(s_state.bound_vars[0].name, &value,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep weighted bindings usable by the AUTO reader

When two or more temperature variables are bound, this condition leaves every AUTO sample unavailable, even when all variables are fresh. The existing editor (bindTempVariable()) and api_temp_bind() still accept weighted bindings, but an unlatched AUTO fan now falls back to 25% indefinitely and never evaluates their overtemperature guard. In the source-extracted host harness, two fresh 98°C inputs produced a valid 98°C effective temperature while AUTO requested 25% with guard_active == false. Preserve weighted control and the hottest-bound-variable guard in the bound-only reader rather than treating supported multi-variable configurations as missing input.

Useful? React with 👍 / 👎.

Comment on lines +529 to +533
if (!new_report && !fan->auto_resume_pending) {
/* Normal asynchronous polling neither creates a sample nor erases
* fractional fall credit. Don't bank time across a report gap. */
if (sample_age_ms > max_report_gap_ms) fan->last_auto_update_ms = now_ms;
return ESP_OK;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Retry failed AUTO PWM writes on duplicate valid reports

If an ordinary AUTO PWM update fails and the next poll reads the same still-valid temperature report, this return suppresses recovery: auto_report_ms was already advanced before the failed write, but neither the outstanding target nor fault is considered here. A one-shot write failure in the host harness left an 80°C fan at 0% through five subsequent valid polls, with no further PWM attempt until the six-second stale fallback. Retry the unconfirmed PWM target on valid duplicate reads without recording another temperature sample or advancing the controller's slew calculation.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 179c08be81

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

continue;
}
if (basic_temp_data_valid) fan->temperature = temp_data.value;
if (fan->mode != TS_FAN_MODE_AUTO && basic_temp_data_valid) fan->temperature = temp_data.value;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Refresh the temperature snapshot for disabled AUTO fans

When an AUTO fan is disabled with ts_fan_enable(false), this new mode check skips the monitoring assignment, while the later disabled-fan continue also prevents apply_adaptive_auto() from consuming fresh bound samples. Consequently, ts_fan_get_status() and the per-fan temperature in fan.status report the pre-disable temperature indefinitely. A source-extracted host probe retained 49°C after 18 seconds of fresh 80°C reports, while global temperature status correctly showed 80°C. Keep updating the temperature-only snapshot for disabled AUTO fans without advancing their controller or changing the zero PWM.

Useful? React with 👍 / 👎.

@massif-01
massif-01 merged commit ab7d8be into RMinte:main Nov 16, 2026
7 checks passed
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