Skip to content

feat: dashboard Maintenance section + serial-based service targeting#114

Merged
dewet22 merged 3 commits into
mainfrom
feat/dashboard-maintenance-controls
Jun 3, 2026
Merged

feat: dashboard Maintenance section + serial-based service targeting#114
dewet22 merged 3 commits into
mainfrom
feat/dashboard-maintenance-controls

Conversation

@dewet22

@dewet22 dewet22 commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Summary

Service changes: redetect_plant and set_system_datetime now accept either device_id (HA device-picker, as before) or serial (inverter serial string, e.g. SA2114G047). New _resolve_target() helper and SERVICE_DEVICE_OR_SERIAL_SCHEMA route either form to the correct config entry — unambiguous in multi-plant installs, and the dashboard can supply the serial at generation time without needing to know HA-internal device IDs.

Dashboard: a new Maintenance section in the Controls view adds two button cards:

  • Redetect Plant (mdi:radar) — calls redetect_plant with serial, with a confirmation dialog; the one-click recovery for a missing battery or topology issue.
  • Sync Inverter Clock (mdi:clock-sync-outline) — calls set_system_datetime with serial.

DASHBOARD_VERSION 6 → 7; existing users see the Dashboard schema outdated repair and can regenerate in one click.

🤖 Generated with Claude Code

…ting

Services — redetect_plant and set_system_datetime now accept either
device_id (HA device picker) or serial (inverter serial string, e.g.
SA2114G047). New _resolve_target() helper routes either to the correct
config entry, unambiguously targeting the right inverter in multi-plant
installs.

Dashboard — a new Maintenance section in the Controls view contains two
button cards with data.serial baked in at generation time:
- Redetect Plant (mdi:radar) — with a confirmation prompt; the one-click
  recovery for a missing-device situation.
- Sync Inverter Clock (mdi:clock-sync-outline).

DASHBOARD_VERSION 6 → 7; existing users get the regenerate repair.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@dewet22, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 31 minutes and 58 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f19645a5-0d1e-447d-a373-baa3171976bb

📥 Commits

Reviewing files that changed from the base of the PR and between bae06a2 and a901852.

📒 Files selected for processing (5)
  • custom_components/givenergy_local/__init__.py
  • custom_components/givenergy_local/dashboard.py
  • custom_components/givenergy_local/services.yaml
  • dashboard/template.yaml
  • tests/test_dashboard.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/dashboard-maintenance-controls

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 and usage tips.

@deepsource-io

deepsource-io Bot commented Jun 3, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in bae06a2...a901852 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
Python Jun 3, 2026 5:33p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

Comment thread tests/test_dashboard.py Outdated
Comment thread tests/test_dashboard.py Outdated

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request updates the GivEnergy integration to allow identifying target inverters by either their Home Assistant-assigned device ID or their serial number. This change is applied to the set_system_datetime and redetect_plant services, and a new "Maintenance" section has been added to the generated dashboard with buttons for these actions. The review feedback points out a potential KeyError in the target resolution logic if neither device_id nor serial is provided, suggesting a schema update to enforce that at least one of the keys is present.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread custom_components/givenergy_local/__init__.py
@dewet22-codex

Copy link
Copy Markdown
Collaborator

I’ve started reviewing this PR.

Comment thread custom_components/givenergy_local/__init__.py
dewet22 and others added 2 commits June 3, 2026 18:31
…_SERIAL_SCHEMA

Addresses Codex review on #114: vol.Exclusive enforces 'not both' but not
'at least one', so a call with {} would pass schema validation and then
raise a raw KeyError in _resolve_target(). Added a vol.All validator that
checks at least one target key is present and raises a clean vol.Invalid.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ols-view absence

Addresses DeepSource review on #114:
- Remove 'import yaml as _yaml' (yaml already imported at top of file)
- Wrap next() for Controls view with an explicit None default and assertion
  rather than letting next() raise StopIteration on a malformed dashboard.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dewet22 dewet22 merged commit 46640a8 into main Jun 3, 2026
10 checks passed
@dewet22 dewet22 deleted the feat/dashboard-maintenance-controls branch June 3, 2026 17:36
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