feat: add sync_status to dashboard cards with per-state styling#1065
Merged
feat: add sync_status to dashboard cards with per-state styling#1065
Conversation
Slot card: - Shows distinct icons per sync state (check-circle, clock-outline, sync, alert-circle) - Color-coded: green (in sync), orange (out of sync/syncing), red (suspended) - Status text shows "Suspended" instead of last-synced time when suspended Lock-codes card: - Warning banner "Sync suspended — lock is unreachable" when coordinator has slot_sync_mgrs_suspended set - Card border turns red with reduced opacity for visual emphasis Backend: - sync_status included in subscribe_lock_codes response when suspended Entire-Checkpoint: 06fd64996697
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1065 +/- ##
==========================================
+ Coverage 95.28% 95.43% +0.15%
==========================================
Files 45 45
Lines 4962 4994 +32
Branches 495 503 +8
==========================================
+ Hits 4728 4766 +38
+ Misses 234 228 -6
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds granular sync-status display to Lock Code Manager’s Lovelace cards (slot + lock-codes), using the new sync_status attribute and a suspended-state banner, plus backend websocket support to surface suspension state.
Changes:
- Slot card: render per-lock sync state with distinct icons/text, and special handling for suspended (hide last-synced time).
- Lock-codes card: show a “Sync suspended — lock is unreachable” banner and suspended card styling.
- Backend/types/styles: extend TS interfaces and websocket
subscribe_lock_codespayload to includesync_statuswhen suspended; add shared error color + new status indicator classes.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| ts/types.ts | Extends frontend data contracts with optional sync_status. |
| ts/slot-card.ts | Uses sync_status to pick icon/text/state classes; suppresses last-synced when suspended. |
| ts/slot-card.styles.ts | Adds styling hooks for suspended/syncing status text. |
| ts/shared-styles.ts | Introduces --lcm-error-color and shared .lcm-sync-icon classes for new states. |
| ts/lock-codes-card.ts | Adds suspended detection and banner rendering. |
| ts/lock-codes-card.styles.ts | Adds suspended border/opacity styling and banner styles. |
| custom_components/lock_code_manager/websocket.py | Adds sync_status: "suspended" to subscribe_lock_codes response when slot sync is suspended. |
| custom_components/lock_code_manager/www/generated/lock-code-manager.js | Regenerates bundled frontend to include the new UI/typing/styling changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 7781fc868eea
0a5d207 to
2b9a8d4
Compare
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change
Adds granular sync status display to both dashboard cards, leveraging the new
sync_statusattribute from #1062.Slot card:
Lock-codes card:
Backend:
sync_statusfield added tosubscribe_lock_codeswebsocket response when suspendedTypeScript types:
sync_status?: stringadded toSlotCardLockStatusandLockCoordinatorDatainterfacesType of change
Additional information