Conversation
Introduces a new Usage Prediction Common Control section at the top of the Home view, displaying commonly used entities. Adds HAUsagePredictionCommonControl model, request, and integration in HomeViewModel. Also moves entity and area registry models to a dedicated Models folder.
Added a conditional branch to render the section header for 'usage-prediction-common-control' without a chevron, distinguishing it from other grouped entities.
Introduces a grid layout for displaying area sections in HomeView, selectable via configuration. Adds the AreaGridButton component for grid presentation and refactors the view logic to support both list and grid layouts.
Extracted AreaGridButton into its own file and enhanced it to support custom icons for each area. Updated HomeView to display a section header for areas and improved the layout of the areas grid. Modified HomeViewModel.RoomSection to include an optional icon property and updated related logic. Added a new localization key for the areas section title.
Entity tiles now visually indicate when an entity is unavailable or unknown by using a gray, dashed border, reduced opacity, and a gray icon color. This improves clarity for users when entities are not accessible.
EntityTileView is now a pure UI component, decoupled from Home Assistant-specific logic. Introduced HomeEntityTileView to encapsulate business logic such as device class lookup, icon color computation, and AppIntents integration. Updated EntityDisplayComponents to use HomeEntityTileView for Home Assistant entities.
Replaces DomainSummaryCard's custom layout with EntityTileView for consistency and code reuse. Updates DomainSummariesSection to use a Section header and adjusts grid spacing to use DesignSystem constants. Refactors icon mapping for domain summaries and removes redundant padding in HomeView. Cleans up formatting and improves maintainability.
Introduces localized strings for summaries, lights, and covers. Refactors DomainSummary to use a Domain enum instead of String, updates summary generation logic, and integrates new localization keys throughout the HomeViewModel and UI components.
Adds optional area name display to entity tiles by passing areaName to HomeEntityTileView and updating grid builders to support areaNameProvider. HomeViewModel now provides areaName lookup for entities, and HomeView passes this for usage prediction sections. Also improves text truncation for tile state display.
Made DomainSummary conform to Equatable and updated the logic to assign domainSummaries only if the new value differs from the current one. Logging now occurs only when domainSummaries is actually updated, reducing unnecessary log noise.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds domain summaries and area context display to the native dashboard in the Home Assistant iOS app. It refactors the EntityTileView into a pure UI component and creates a new HomeEntityTileView for Home Assistant-specific logic, while introducing domain summary cards that show aggregate status for entities like lights and covers.
Changes:
- Refactored
EntityTileViewto be a pure UI component with business logic extracted toHomeEntityTileView - Added domain summary functionality to compute and display aggregate entity states (lights, covers)
- Enhanced entity tiles to show area context information in the usage prediction section
- Added localized strings for summary titles
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| Sources/Shared/Resources/Swiftgen/Strings.swift | Generated localization strings for summaries feature |
| Sources/App/WebView/ExperimentalSpace/Shared/EntityDisplayComponents.swift | Updated entity grid components to support area name provider |
| Sources/App/WebView/ExperimentalSpace/Home/HomeViewModel.swift | Added domain summary computation logic and area name lookup |
| Sources/App/WebView/ExperimentalSpace/Home/HomeView.swift | Integrated summaries section and area context into home view |
| Sources/App/WebView/ExperimentalSpace/Home/DomainSummaryCard.swift | New component for displaying domain summary cards |
| Sources/App/WebView/ExperimentalSpace/EntityTile/HomeEntityTileView.swift | New Home Assistant-specific entity tile with business logic |
| Sources/App/WebView/ExperimentalSpace/EntityTile/EntityTileView.swift | Refactored to pure UI component |
| Sources/App/Resources/en.lproj/Localizable.strings | Added English localization for summaries |
| HomeAssistant.xcodeproj/project.pbxproj | Added new files to Xcode project |
Sources/App/WebView/ExperimentalSpace/Home/DomainSummaryCard.swift
Outdated
Show resolved
Hide resolved
Introduces new localized strings for Home view summaries, including lights, covers, and active counts. Updates DomainSummaryCard and HomeViewModel to use these localized strings via Swiftgen, improving internationalization and consistency.
Introduces a new 'showSummaries' option in HomeViewConfiguration, allowing users to enable or disable the display of summaries in the Home view. Updates the UI to include a toggle for this setting and adds necessary localization and database support.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4221 +/- ##
======================================
Coverage ? 0
======================================
Files ? 0
Lines ? 0
Branches ? 0
======================================
Hits ? 0
Misses ? 0
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
Screenshots
Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#
Any other notes