feat: dashboard Maintenance section + serial-based service targeting#114
Conversation
…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>
|
Warning Review limit reached
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 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
|
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.
There was a problem hiding this comment.
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.
|
I’ve started reviewing this PR. |
…_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>
Summary
Service changes:
redetect_plantandset_system_datetimenow accept eitherdevice_id(HA device-picker, as before) orserial(inverter serial string, e.g.SA2114G047). New_resolve_target()helper andSERVICE_DEVICE_OR_SERIAL_SCHEMAroute 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:
mdi:radar) — callsredetect_plantwithserial, with a confirmation dialog; the one-click recovery for a missing battery or topology issue.mdi:clock-sync-outline) — callsset_system_datetimewithserial.DASHBOARD_VERSION6 → 7; existing users see the Dashboard schema outdated repair and can regenerate in one click.🤖 Generated with Claude Code