Skip to content

Send location in zones when using SEND_LOCATION_AS_ZONE_ONLY#6879

Merged
TimoPtr merged 6 commits into
mainfrom
feature/send_location_in_zones
May 27, 2026
Merged

Send location in zones when using SEND_LOCATION_AS_ZONE_ONLY#6879
TimoPtr merged 6 commits into
mainfrom
feature/send_location_in_zones

Conversation

@TimoPtr
Copy link
Copy Markdown
Member

@TimoPtr TimoPtr commented May 21, 2026

Summary

To fulfill the new requirements in core we need to send in_zones when we send a location update using zone only. See home-assistant/architecture#1387 for more details. Implemented in core home-assistant/core#171814

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.

Screenshots

image

Any other notes

@TimoPtr TimoPtr marked this pull request as ready for review May 26, 2026 10:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 location reporting so zone-only updates can send the new in_zones payload expected by newer Home Assistant Core versions, while preserving location_name compatibility for older servers.

Changes:

  • Adds inZones to the update-location domain and wire models, including custom serialization support.
  • Computes all matching active zones for zone-only location updates and gates sending in_zones on Core >= 2026.6.0.
  • Persists and displays in_zones in location history through a Room schema bump.

Reviewed changes

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

Show a summary per file
File Description
common/src/main/kotlin/io/homeassistant/companion/android/database/location/LocationHistoryItem.kt Adds persisted inZones, sharing output, and a Room converter.
common/src/main/kotlin/io/homeassistant/companion/android/database/AppDatabase.kt Bumps Room database version and adds auto-migration 51→52.
common/src/main/kotlin/io/homeassistant/companion/android/common/data/integration/UpdateLocation.kt Extends the location update DTO with inZones.
common/src/main/kotlin/io/homeassistant/companion/android/common/data/integration/impl/IntegrationRepositoryImpl.kt Forwards inZones into the webhook request model.
common/src/main/kotlin/io/homeassistant/companion/android/common/data/integration/impl/entities/UpdateLocationRequest.kt Adds in_zones to the custom request serializer/deserializer.
common/schemas/io.homeassistant.companion.android.database.AppDatabase/52.json Captures the new Room schema with the in_zones column.
app/src/main/kotlin/io/homeassistant/companion/android/settings/developer/location/views/LocationTrackingView.kt Displays stored zones in the developer location history row.
app/src/full/kotlin/io/homeassistant/companion/android/sensors/LocationSensorManager.kt Computes matching zones and sends inZones for supported Core versions.

Co-authored-by: Joris Pelgröm <jpelgrom@users.noreply.github.com>
@TimoPtr TimoPtr merged commit ed15230 into main May 27, 2026
24 checks passed
@TimoPtr TimoPtr deleted the feature/send_location_in_zones branch May 27, 2026 09:27
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