Conversation
TimoPtr
reviewed
May 26, 2026
4 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for Home Assistant Core’s new in_zones field in update_location webhook payloads when the app is configured to send zone-only location updates, gated by Core version support.
Changes:
- Add
in_zonestoWebhookUpdateLocationand populate it for zone-only location updates when supported by Core. - Introduce
RLMZone.zones(of:in:includingPassive:)to return all matching zones (sorted by radius) and use it when building zone-only updates. - Extend unit tests for the new
in_zonespayload and the new multi-zone lookup behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/Shared/Webhook/WebhookUpdateLocation.test.swift | Adds coverage for serializing in_zones when using the zone-name initializer. |
| Tests/Shared/RealmZone.test.swift | Adds coverage for returning all matching zones and excluding passive zones when requested. |
| Sources/Shared/Environment/AppConstants.swift | Adds a Core version gate constant for in_zones support. |
| Sources/Shared/API/Models/WebhookUpdateLocation.swift | Adds inZones to the model and maps it to in_zones in JSON. |
| Sources/Shared/API/Models/RealmZone.swift | Adds zones(...) API to return all matching zones (sorted) and reimplements zone(...) via it. |
| Sources/Shared/API/HAAPI.swift | Sends in_zones in zone-only payloads when supported and derives location_name from the first non-passive zone where applicable. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Merged
7 tasks
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
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
Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#
Any other notes