Skip to content

Add Improv external bus messages models#6817

Open
TimoPtr wants to merge 1 commit intomainfrom
feature/improv_messages
Open

Add Improv external bus messages models#6817
TimoPtr wants to merge 1 commit intomainfrom
feature/improv_messages

Conversation

@TimoPtr
Copy link
Copy Markdown
Member

@TimoPtr TimoPtr commented May 7, 2026

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

  • 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.

Copilot AI review requested due to automatic review settings May 7, 2026 12:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/get response with canSetupImprov, derived from Bluetooth LE availability via an injected BluetoothCapabilities
  • 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

@TimoPtr TimoPtr deployed to ui-test May 7, 2026 12:25 — with GitHub Actions Active
@jpelgrom
Copy link
Copy Markdown
Member

jpelgrom commented May 7, 2026

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.

Nice improvement. Do you want to change it in the existing files as well?

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