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

@TimoPtr TimoPtr commented May 21, 2026

Copy link
Copy Markdown
Member

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

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 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
bgoncal added a commit to home-assistant/iOS that referenced this pull request Jun 3, 2026
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->

## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->
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

Android PR: home-assistant/android#6879
## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->

## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#

## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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