Skip to content

Fix EntityWidgetConfigure build - #7264

Merged
TimoPtr merged 2 commits into
mainfrom
fix/entity_widget_configure_wrong_usage
Jul 28, 2026
Merged

Fix EntityWidgetConfigure build#7264
TimoPtr merged 2 commits into
mainfrom
fix/entity_widget_configure_wrong_usage

Conversation

@TimoPtr

@TimoPtr TimoPtr commented Jul 28, 2026

Copy link
Copy Markdown
Member

Summary

We've merged #7007 but it was not up to date on main and we end up into a build that is not building because of that. This Pr fix this by simply using the new methods available in the use case.

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.
  • I have read the Open Home Foundation AI Policy.

Select exactly one option that describes AI usage in this contribution:

  • I have not used AI for this contribution.
  • AI assistance was used for this contribution.
  • AI fully generated the code for this contribution, but I've reviewed and understood it before submitting and will respond without AI during review.

Copilot AI review requested due to automatic review settings July 28, 2026 06:53
@TimoPtr
TimoPtr enabled auto-merge (squash) July 28, 2026 06:54

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 Entity Widget configuration flow to match the updated GetEntitiesForDisplayUseCase API (post-#7007), unblocking compilation by switching call sites and tests to the new snapshot(...) method and the updated EntityDisplayItem construction.

Changes:

  • Update EntityWidgetConfigureViewModel to use getEntitiesForDisplay.snapshot(serverId) instead of the previous call form.
  • Update unit/UI tests and preview state to construct EntityDisplayItem via EntityDisplayItem(entity) (instead of the removed .from(...)).
  • Adjust ViewModel tests to mock getEntitiesForDisplay.snapshot(...).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
app/src/test/kotlin/io/homeassistant/companion/android/widgets/entity/EntityWidgetConfigureViewModelTest.kt Updates mocks/helpers to use snapshot(...) and EntityDisplayItem(entity) construction.
app/src/test/kotlin/io/homeassistant/companion/android/widgets/entity/EntityWidgetConfigureScreenTest.kt Updates test state to use EntityDisplayItem(ENTITY) instead of EntityDisplayItem.from(...).
app/src/main/kotlin/io/homeassistant/companion/android/widgets/entity/EntityWidgetConfigureViewModel.kt Switches entity loading to getEntitiesForDisplay.snapshot(serverId).
app/src/main/kotlin/io/homeassistant/companion/android/widgets/entity/EntityWidgetConfigureScreen.kt Updates preview state to use the new EntityDisplayItem(previewEntity1) constructor.

@jpelgrom
jpelgrom disabled auto-merge July 28, 2026 07:03
@TimoPtr
TimoPtr enabled auto-merge (squash) July 28, 2026 07:10
@TimoPtr
TimoPtr merged commit 5131ea0 into main Jul 28, 2026
24 checks passed
@TimoPtr
TimoPtr deleted the fix/entity_widget_configure_wrong_usage branch July 28, 2026 07:46
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.

3 participants