Skip to content

Huawei: add curtailment api#28549

Draft
CiNcH83 wants to merge 5 commits intoevcc-io:masterfrom
CiNcH83:huawei_curtailment
Draft

Huawei: add curtailment api#28549
CiNcH83 wants to merge 5 commits intoevcc-io:masterfrom
CiNcH83:huawei_curtailment

Conversation

@CiNcH83
Copy link
Contributor

@CiNcH83 CiNcH83 commented Mar 25, 2026

[Depends on #28538]

Open Questions

  • It would also be possible to set the mode programmatically via register 47415, see here. But it is kind of redundant to do it on every call!?

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • In curtailMeter.Curtailed, you return val < m.nominalLimit even when curtailedG returns an error; consider short‑circuiting and returning false, err on error to avoid exposing a potentially misleading curtailed state when the underlying read failed.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `curtailMeter.Curtailed`, you return `val < m.nominalLimit` even when `curtailedG` returns an error; consider short‑circuiting and returning `false, err` on error to avoid exposing a potentially misleading curtailed state when the underlying read failed.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@CiNcH83 CiNcH83 marked this pull request as draft March 25, 2026 15:16
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