Skip to content

Create raedian.go #22471

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Create raedian.go #22471

wants to merge 1 commit into from

Conversation

webdotpulse
Copy link

support for the RAEDIAN NEO and RAEDIAN NEX EV chargers

support for the RAEDIAN NEO and RAEDIAN NEX EV chargers
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 @webdotpulse - I've reviewed your changes - here's some feedback:

  • Clarify the license header—currently it declares “NOT covered by MIT” but includes MIT boilerplate, please reconcile the intended licensing.
  • The sponsor.IsAuthorized check in NewRaedian completely blocks usage without a sponsor key; consider making this gating configurable or clearly documenting it.
  • You register phase‐switching and meter features unconditionally—consider adding runtime detection or config flags so unsupported operations aren’t exposed on NEO devices.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Clarify the license header—currently it declares “NOT covered by MIT” but includes MIT boilerplate, please reconcile the intended licensing.
- The sponsor.IsAuthorized check in NewRaedian completely blocks usage without a sponsor key; consider making this gating configurable or clearly documenting it.
- You register phase‐switching and meter features unconditionally—consider adding runtime detection or config flags so unsupported operations aren’t exposed on NEO devices.

## Individual Comments

### Comment 1
<location> `charger/raedian.go:400` </location>
<code_context>
+var _ api.Diagnosis = (*Raedian)(nil)
+
+// Diagnose implements the api.Diagnosis interface
+func (wb *Raedian) Diagnose() {
+	if b, err := wb.conn.ReadHoldingRegisters(raedianRegSerialNumber, 4); err == nil {
+		serial := binary.BigEndian.Uint64(b)
</code_context>

<issue_to_address>
No error handling or output for failed Modbus reads in Diagnose.

Consider displaying an error message or placeholder when a Modbus read fails to make missing data visible for troubleshooting.
</issue_to_address>

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.

var _ api.Diagnosis = (*Raedian)(nil)

// Diagnose implements the api.Diagnosis interface
func (wb *Raedian) Diagnose() {
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion (bug_risk): No error handling or output for failed Modbus reads in Diagnose.

Consider displaying an error message or placeholder when a Modbus read fails to make missing data visible for troubleshooting.

@andig andig marked this pull request as draft July 21, 2025 06:28
@andig andig added the devices Specific device support label Jul 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devices Specific device support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy