Skip to content

Fix onAnyLocationUpdated GraphQL subscription and mapping - #501

Merged
ic-dev21 merged 1 commit into
dvd-dev:mainfrom
Moustachauve:fix/location-updated-subscription
Nov 21, 2026
Merged

ic-dev21 merged 1 commit into
dvd-dev:mainfrom
Moustachauve:fix/location-updated-subscription

Conversation

@Moustachauve

Copy link
Copy Markdown
Contributor

GraphQlHelper.subscribe_to_location_updated already exists in python-hilo, but any consumer that calls it cannot receive location-wide connectionStatus updates: the query selects fields that no longer match Hilo's Digital-Twin LocationSubscription schema, the mapper routes partial location payloads through full device builders that require deviceType and telemetry fields, and the handler returns the location ID instead of the updated devices' hilo_ids.

Update SUBSCRIPTION_LOCATION_UPDATED and map_location_subscription_values to match Hilo's Digital-Twin schema (skipping unmigrated BasicDevice stubs so null statuses do not overwrite SignalR-managed devices, and keeping Gateway onlineStatus in sync), and have subscription handlers return all updated device hilo_ids so callers receive a callback for every affected device.

Note: subscribe_to_location_updated is not currently used by the hilo Home Assistant integration, so removing (or deprecating) this code path instead is also an option if maintainers prefer not to keep it.

`GraphQlHelper.subscribe_to_location_updated` already exists in `python-hilo`, but any consumer that calls it cannot receive location-wide `connectionStatus` updates: the query selects fields that no longer match Hilo's Digital-Twin `LocationSubscription` schema, the mapper routes partial location payloads through full device builders that require `deviceType` and telemetry fields, and the handler returns the location ID instead of the updated devices' `hilo_id`s.

Update `SUBSCRIPTION_LOCATION_UPDATED` and `map_location_subscription_values` to match Hilo's Digital-Twin schema (skipping unmigrated `BasicDevice` stubs so null statuses do not overwrite SignalR-managed devices, and keeping Gateway `onlineStatus` in sync), and have subscription handlers return all updated device `hilo_id`s so callers receive a callback for every affected device.

Note: `subscribe_to_location_updated` is not currently used by the `hilo` Home Assistant integration, so removing (or deprecating) this code path instead is also an option if maintainers prefer not to keep it.
@Moustachauve
Moustachauve marked this pull request as ready for review November 20, 2026 04:04
@ic-dev21
ic-dev21 merged commit ac37d9c into dvd-dev:main Nov 21, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants