Open
Conversation
There was a problem hiding this comment.
Pull request overview
Implements a new device/unit synchronization approach between Home Assistant (HA) and BCO, moving device/entity linking logic into dedicated UnitSyncStrategy implementations and extending the synchronizer to support custom unit queries.
Changes:
- Added
DeviceSyncStrategy(HA → BCO device creation/update) andEntitySyncStrategy(link HA entities to auto-created DAL units). - Extended
UnitSyncStrategy/UnitSynchronizerwithqueryUnitConfigs(...)to support strategies that span multiple unit types or require custom selection. - Updated HA device update payload handling (
name_by_useretc.) and hardened label best-match resolution.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/kotlin/org/openbase/bco/gateway/homeassistant/sync/UnitSynchronizerTest.kt | Updates test mocks to cover the new queryUnitConfigs(...) path. |
| src/main/kotlin/org/openbase/bco/gateway/homeassistant/util/LabelExtensions.kt | Makes label best-match retrieval exception-safe. |
| src/main/kotlin/org/openbase/bco/gateway/homeassistant/sync/UnitSynchronizer.kt | Uses strategy-provided unit queries and skips invalid configs returned by strategies. |
| src/main/kotlin/org/openbase/bco/gateway/homeassistant/sync/strategy/UnitSyncStrategy.kt | Adds default queryUnitConfigs(...) hook for custom unit selection. |
| src/main/kotlin/org/openbase/bco/gateway/homeassistant/sync/strategy/EntitySyncStrategy.kt | New entity↔DAL linking strategy (HA entities mapped onto BCO DAL units). |
| src/main/kotlin/org/openbase/bco/gateway/homeassistant/sync/strategy/DeviceSyncStrategy.kt | New device synchronization strategy with device-class matching. |
| src/main/kotlin/org/openbase/bco/gateway/homeassistant/manager/HassDeviceManager.kt | Integrates the new synchronizers and switches state filtering to use the entity cache. |
| src/main/kotlin/org/openbase/bco/gateway/homeassistant/manager/dto/HassEntityInputDto.kt | Adds HA entity input DTO type. |
| src/main/kotlin/org/openbase/bco/gateway/homeassistant/manager/dto/HassEntityDto.kt | Makes entity DTO compatible with synchronizer generics (merge/input provider) and relaxes nullable fields. |
| src/main/kotlin/org/openbase/bco/gateway/homeassistant/manager/dto/HassDeviceInputDto.kt | Adds name_by_user support for HA device updates. |
| src/main/kotlin/org/openbase/bco/gateway/homeassistant/manager/dto/HassDeviceDto.kt | Adds nameByUser field and merge/input mapping. |
| src/main/kotlin/org/openbase/bco/gateway/homeassistant/communication/HassCommunicator.kt | Fixes HA device update payload to use device_id + accepted fields only. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…update for devices/entities
DivineThreepwood
requested changes
Apr 9, 2026
DivineThreepwood
previously approved these changes
Apr 9, 2026
DivineThreepwood
previously approved these changes
Apr 9, 2026
DivineThreepwood
approved these changes
Apr 14, 2026
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.
📜 Description
🧪 Test Procedure