Skip to content

Config UI: allow disabling devices#29455

Open
andig wants to merge 2 commits intomasterfrom
feat/disable
Open

Config UI: allow disabling devices#29455
andig wants to merge 2 commits intomasterfrom
feat/disable

Conversation

@andig
Copy link
Copy Markdown
Member

@andig andig commented Apr 27, 2026

Fix #21144

TODO

@andig andig added enhancement New feature or request prio Priority labels Apr 27, 2026
Copy link
Copy Markdown
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 configureLoadpoints, when conf.Disable is true the instance remains nil but is still wrapped in NewConfigurableDevice; consider ensuring all consumers guard against a nil loadpoint.API or creating a small disabled stub implementation to avoid potential nil dereferences.
  • In configurableInstance, the disabled path leaves instance as the zero value of T without returning an error; consider making the disabled behavior explicit (e.g., early return or a dedicated disabled state) so callers don’t have to implicitly rely on a zero-value instance.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `configureLoadpoints`, when `conf.Disable` is true the `instance` remains `nil` but is still wrapped in `NewConfigurableDevice`; consider ensuring all consumers guard against a nil `loadpoint.API` or creating a small disabled stub implementation to avoid potential nil dereferences.
- In `configurableInstance`, the disabled path leaves `instance` as the zero value of `T` without returning an error; consider making the disabled behavior explicit (e.g., early return or a dedicated disabled state) so callers don’t have to implicitly rely on a zero-value instance.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request prio Priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Config UI: Geräte deaktivieren

2 participants