Skip to content

Remove friendly name usage in auto screens#7191

Open
TimoPtr wants to merge 1 commit into
feature/obverse_entity_state_for_displayfrom
feature/auto_remove_friendly_name_usage
Open

Remove friendly name usage in auto screens#7191
TimoPtr wants to merge 1 commit into
feature/obverse_entity_state_for_displayfrom
feature/auto_remove_friendly_name_usage

Conversation

@TimoPtr

@TimoPtr TimoPtr commented Jul 16, 2026

Copy link
Copy Markdown
Member

Summary

This PR replace the usage of friendly name within the android auto screens with the GetEntityForDisplayUseCase.obvserve.

Checklist

  • New or updated tests have been added to cover the changes following the testing guidelines.
  • The code follows the project's code style and best_practices.
  • The changes have been thoroughly tested, and edge cases have been considered.
  • Changes are backward compatible whenever feasible. Any breaking changes are documented in the changelog for users and/or in the code for developers depending on the relevance.

Any other notes

Based on #7189

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/friendlyState usage in vehicle screens with EntityDisplayItem + EntityDisplayState flows.
  • Rework HaCarAppService and vehicle screens to observe entity display state (loading/loaded/error) rather than manually merging entity updates.
  • Replace Entity.onPressed(...) with a parameterized onEntityPressed(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 calls onEntityPressed(...). 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
TimoPtr force-pushed the feature/obverse_entity_state_for_display branch from 32efdf6 to 45808fe Compare July 17, 2026 07:59
@TimoPtr
TimoPtr force-pushed the feature/auto_remove_friendly_name_usage branch from e784864 to ee33d75 Compare July 17, 2026 07:59
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Test Results

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
0 files    0 ❌

Results for commit b549673.

♻️ This comment has been updated with latest results.

@TimoPtr
TimoPtr force-pushed the feature/obverse_entity_state_for_display branch from 45808fe to 09f0a07 Compare July 17, 2026 09:44
@TimoPtr
TimoPtr force-pushed the feature/auto_remove_friendly_name_usage branch from ee33d75 to e2afe93 Compare July 17, 2026 09:44
@TimoPtr
TimoPtr force-pushed the feature/obverse_entity_state_for_display branch from 09f0a07 to d9d9a56 Compare July 20, 2026 07:39
@TimoPtr
TimoPtr force-pushed the feature/auto_remove_friendly_name_usage branch from e2afe93 to b549673 Compare July 20, 2026 07:39
@TimoPtr
TimoPtr force-pushed the feature/obverse_entity_state_for_display branch 2 times, most recently from 3956afd to bdc62e5 Compare July 20, 2026 13:43
@TimoPtr
TimoPtr force-pushed the feature/auto_remove_friendly_name_usage branch 3 times, most recently from f36dded to 4557edc Compare July 20, 2026 14:14
@TimoPtr
TimoPtr force-pushed the feature/obverse_entity_state_for_display branch from 2ee00a1 to 7c91332 Compare July 20, 2026 14:36
@TimoPtr
TimoPtr force-pushed the feature/auto_remove_friendly_name_usage branch from 4557edc to 0305b9c Compare July 20, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use GetEntitiesForDisplayUseCase in Android auto screens

2 participants