Remove friendly name usage in auto screens#7191
Open
TimoPtr wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Android Auto/Automotive screens to stop using per-screen “friendly name/state” helpers and instead consume the resolved EntityDisplayItem stream from GetEntitiesForDisplayUseCase.observe(...), centralizing display metadata and live updates.
Changes:
- Replace
Entity/friendlyName/friendlyStateusage in vehicle screens withEntityDisplayItem+EntityDisplayStateflows. - Rework
HaCarAppServiceand vehicle screens to observe entity display state (loading/loaded/error) rather than manually merging entity updates. - Replace
Entity.onPressed(...)with a parameterizedonEntityPressed(entityId, currentState, ...)helper.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| common/src/main/kotlin/io/homeassistant/companion/android/common/data/integration/Entity.kt | Introduces onEntityPressed(...) and updates related press helpers/docs. |
| app/src/main/kotlin/io/homeassistant/companion/android/vehicle/MapVehicleScreen.kt | Switches map UI to EntityDisplayItem fields (name/state/icon/coordinates). |
| app/src/main/kotlin/io/homeassistant/companion/android/vehicle/MainVehicleScreen.kt | Consumes EntityDisplayState and derives favorites/domains from display items. |
| app/src/main/kotlin/io/homeassistant/companion/android/vehicle/HaCarAppService.kt | Replaces manual entity+updates wiring with GetEntitiesForDisplayUseCase.observe(...). |
| app/src/main/kotlin/io/homeassistant/companion/android/vehicle/EntityGridVehicleScreen.kt | Updates entity grid rendering/actions to use EntityDisplayItem and onEntityPressed(...). |
| app/src/main/kotlin/io/homeassistant/companion/android/vehicle/DomainListScreen.kt | Updates domain list derivation to use EntityDisplayState. |
| app/src/main/kotlin/io/homeassistant/companion/android/util/vehicle/TemplateComponents.kt | Routes navigation/domain lists through EntityDisplayState and isHidden. |
| app/src/main/kotlin/io/homeassistant/companion/android/util/vehicle/DomainChecks.kt | Adds/uses EntityDisplayItem navigation checks while keeping Entity variants. |
Comments suppressed due to low confidence (1)
app/src/main/kotlin/io/homeassistant/companion/android/vehicle/EntityGridVehicleScreen.kt:187
- The log message still refers to
onPressed, but this screen now callsonEntityPressed(...). Updating the message (and ideally including the entityId) will make logs easier to understand.
} catch (e: CancellationException) {
throw e
} catch (e: Exception) {
Timber.e(e, "Failed to handle entity onPressed")
}
Comment on lines
+42
to
46
| entitiesState.collect { state -> | ||
| if (state !is EntityDisplayState.Loaded) return@collect | ||
| val newDomains = state.entities | ||
| .map { it.domain } | ||
| .distinct() |
Comment on lines
117
to
121
| } | ||
| val intent = Intent( | ||
| CarContext.ACTION_NAVIGATE, | ||
| "geo:${pair.second[0]},${pair.second[1]}".toUri(), | ||
| "geo:${pair.second.latitude},${pair.second.longitude}".toUri(), | ||
| ) |
TimoPtr
force-pushed
the
feature/obverse_entity_state_for_display
branch
from
July 17, 2026 07:59
32efdf6 to
45808fe
Compare
TimoPtr
force-pushed
the
feature/auto_remove_friendly_name_usage
branch
from
July 17, 2026 07:59
e784864 to
ee33d75
Compare
Contributor
Test Results0 tests 0 ✅ 0s ⏱️ Results for commit b549673. ♻️ This comment has been updated with latest results. |
TimoPtr
force-pushed
the
feature/obverse_entity_state_for_display
branch
from
July 17, 2026 09:44
45808fe to
09f0a07
Compare
TimoPtr
force-pushed
the
feature/auto_remove_friendly_name_usage
branch
from
July 17, 2026 09:44
ee33d75 to
e2afe93
Compare
TimoPtr
force-pushed
the
feature/obverse_entity_state_for_display
branch
from
July 20, 2026 07:39
09f0a07 to
d9d9a56
Compare
TimoPtr
force-pushed
the
feature/auto_remove_friendly_name_usage
branch
from
July 20, 2026 07:39
e2afe93 to
b549673
Compare
TimoPtr
force-pushed
the
feature/obverse_entity_state_for_display
branch
2 times, most recently
from
July 20, 2026 13:43
3956afd to
bdc62e5
Compare
TimoPtr
force-pushed
the
feature/auto_remove_friendly_name_usage
branch
3 times, most recently
from
July 20, 2026 14:14
f36dded to
4557edc
Compare
TimoPtr
force-pushed
the
feature/obverse_entity_state_for_display
branch
from
July 20, 2026 14:36
2ee00a1 to
7c91332
Compare
TimoPtr
force-pushed
the
feature/auto_remove_friendly_name_usage
branch
from
July 20, 2026 14:37
4557edc to
0305b9c
Compare
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
This PR replace the usage of friendly name within the android auto screens with the
GetEntityForDisplayUseCase.obvserve.Checklist
Any other notes
Based on #7189