feat(ui): register dashboard strategy with HA 2026.5+ picker#1124
feat(ui): register dashboard strategy with HA 2026.5+ picker#1124
Conversation
Auto-discoverable in Settings > Dashboards > Add Dashboard via the new window.customStrategies API. Falls back gracefully on older HA versions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Entire-Checkpoint: a27025df6868
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1124 +/- ##
=======================================
Coverage 96.69% 96.69%
=======================================
Files 47 47
Lines 5515 5515
Branches 475 475
=======================================
Hits 5333 5333
Misses 182 182
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds Home Assistant 2026.5+ dashboard-picker integration by registering Lock Code Manager’s dashboard strategy via the new window.customStrategies API, so users can create the dashboard directly from Settings → Dashboards → Add Dashboard while keeping YAML strategy support for older HA versions.
Changes:
- Register the LCM dashboard strategy in
window.customStrategies(name/type/description/docs URL metadata). - Add TypeScript global typing for
window.customStrategies. - Update README copy to describe the new one-click dashboard flow for HA 2026.5+.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| ts/main.ts | Defines strategy custom elements and registers the dashboard strategy metadata via window.customStrategies. |
| README.md | Updates UI & Dashboards section to mention HA 2026.5+ dashboard picker flow. |
| custom_components/lock_code_manager/www/generated/lock-code-manager.js | Regenerated frontend bundle containing the window.customStrategies registration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Proposed change
Registers the LCM dashboard strategy via the new
window.customStrategiesAPIintroduced in Home Assistant 2026.5. On HA 2026.5+, Lock Code Manager
now appears directly in Settings → Dashboards → Add Dashboard, so users
don't have to manually create a blank dashboard, open the Raw configuration
editor, and paste YAML. The YAML path still works for older HA and for
customizing strategy options.
The registration is additive metadata — on HA < 2026.5 it's harmless (nothing
reads
window.customStrategies), so no version gating is needed in code.Only the dashboard strategy registers. The view and section strategies are
referenced from within YAML the user is already editing, so the new picker API
doesn't apply.
Wiki updates landed alongside this PR (separate repo): the install quick-start
now leads with the new flow, and the UI Strategies reference notes the picker
behavior.
Type of change
Additional information
🤖 Generated with Claude Code