Skip to content

识别电量失败通知 - #2489

Merged
ShadowLemoon merged 1 commit into
OneDragon-Anything:mainfrom
JoshCai233:charge-error-notify
Jul 14, 2026
Merged

识别电量失败通知#2489
ShadowLemoon merged 1 commit into
OneDragon-Anything:mainfrom
JoshCai233:charge-error-notify

Conversation

@JoshCai233

@JoshCai233 JoshCai233 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • 功能改进
    • 电量识别步骤失败时,将触发相应的失败通知,帮助及时了解流程异常。

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

在充电计划流程的“识别电量”节点上新增当前节点失败通知配置,其他流程逻辑和公开实体未变更。

Changes

充电计划通知

Layer / File(s) Summary
电量识别失败通知配置
src/zzz_od/application/charge_plan/charge_plan_app.py
为“识别电量”节点添加 CURRENT_FAIL 通知装饰器,使当前节点失败时触发通知逻辑。

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: usagi-wusaqi

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题简洁地概括了为“识别电量”流程新增失败通知的变更。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/zzz_od/application/charge_plan/charge_plan_app.py (1)

132-141: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

round_retry(...) 不会触发 CURRENT_FAIL 通知
这里返回的是 round_retry(...),而 CURRENT_FAIL 只会在 round_result.is_fail 为真时发送;RETRY 不算失败。因此“未识别到电量”不会立刻上报失败通知,只有重试耗尽后被框架转成 FAIL 才会触发。若要在识别失败时立即告警,这里应改为 round_fail(...),或单独给 retry 补通知。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/zzz_od/application/charge_plan/charge_plan_app.py` around lines 132 -
141, 在 check_charge_power 中处理 digit 为 None 的分支时,将 round_retry('未识别到电量', wait=1)
改为立即返回 round_fail,以确保识别失败直接触发 CURRENT_FAIL 通知;保留成功识别路径不变。
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@src/zzz_od/application/charge_plan/charge_plan_app.py`:
- Around line 132-141: 在 check_charge_power 中处理 digit 为 None 的分支时,将
round_retry('未识别到电量', wait=1) 改为立即返回 round_fail,以确保识别失败直接触发 CURRENT_FAIL
通知;保留成功识别路径不变。

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e69a667b-1ffb-4072-b6cf-246d422673e0

📥 Commits

Reviewing files that changed from the base of the PR and between 74c6e61 and 14832f3.

📒 Files selected for processing (1)
  • src/zzz_od/application/charge_plan/charge_plan_app.py

@ShadowLemoon
ShadowLemoon merged commit c4e3657 into OneDragon-Anything:main Jul 14, 2026
8 checks passed
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jul 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants