Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Introduces typed external-bus message models and capability reporting for Improv (BLE-based Wi‑Fi onboarding) in the Compose FrontendScreen path, plus unit tests to validate parsing/serialization and handler routing.
Changes:
- Added incoming (
improv/scan,improv/configure_device) and outgoing (improv/discovered_device,improv/device_setup_done) external bus message models - Extended
config/getresponse withcanSetupImprov, derived from Bluetooth LE availability via an injectedBluetoothCapabilities - Added/updated unit tests covering JSON parsing, serialization, and handler event emission for the new message types
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| app/src/main/kotlin/io/homeassistant/companion/android/frontend/externalbus/incoming/IncomingExternalBusMessage.kt | Adds typed incoming Improv message models |
| app/src/main/kotlin/io/homeassistant/companion/android/frontend/externalbus/outgoing/CommandMessage.kt | Adds outgoing Improv command factories/messages |
| app/src/main/kotlin/io/homeassistant/companion/android/frontend/externalbus/outgoing/OutgoingExternalBusMessage.kt | Adds canSetupImprov to ConfigResult factory/payload |
| app/src/main/kotlin/io/homeassistant/companion/android/frontend/handler/FrontendMessageHandler.kt | Routes Improv incoming messages to handler events; reports canSetupImprov in config |
| app/src/main/kotlin/io/homeassistant/companion/android/frontend/handler/FrontendHandlerEvent.kt | Adds handler events for starting scan and configuring a selected device |
| app/src/main/kotlin/io/homeassistant/companion/android/frontend/FrontendViewModel.kt | Temporarily ignores Improv events (logs only) |
| app/src/main/kotlin/io/homeassistant/companion/android/frontend/improv/BluetoothCapabilities.kt | Introduces testable BLE capability interface |
| app/src/main/kotlin/io/homeassistant/companion/android/frontend/improv/FrontendImprovModule.kt | Hilt provider for BluetoothCapabilities using PackageManager |
| app/src/test/kotlin/io/homeassistant/companion/android/frontend/handler/FrontendMessageHandlerTest.kt | Adds handler tests for config flag + Improv events |
| app/src/test/kotlin/io/homeassistant/companion/android/frontend/externalbus/incoming/IncomingExternalBusMessageTest.kt | Adds decode tests for Improv incoming messages |
| app/src/test/kotlin/io/homeassistant/companion/android/frontend/externalbus/outgoing/OutgoingExternalBusMessageTest.kt | Adds config serialization/assertions for canSetupImprov |
| app/src/test/kotlin/io/homeassistant/companion/android/frontend/externalbus/outgoing/CommandMessageTest.kt | Adds serialization tests for new Improv outgoing commands |
Member
Nice improvement. Do you want to change it in the existing files as well? |
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
This is the first PR to introduce Improv into the FrontendScreen, it basically contains all the data model used. I've also disabled Improve at the GetConfig level when we don't have BLE on the device which makes more sense than even showing the dialog.
Checklist