Skip to content

Add incoming external bus messages for Matter/Thread#6872

Open
TimoPtr wants to merge 1 commit into
mainfrom
feature/matter_external_bus_messages
Open

Add incoming external bus messages for Matter/Thread#6872
TimoPtr wants to merge 1 commit into
mainfrom
feature/matter_external_bus_messages

Conversation

@TimoPtr
Copy link
Copy Markdown
Member

@TimoPtr TimoPtr commented May 20, 2026

Summary

Add incoming external bus messages for matter and mapping into the ViewModel with dumb logs to prepare the impl of the matter onboarding flow.

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 20, 2026 11:43
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

This PR introduces new incoming external bus message types for Matter commissioning and Thread credential import, wiring them through JSON parsing into FrontendMessageHandler events and (currently) a placeholder branch in FrontendViewModel.

Changes:

  • Added matter/commission and thread/import_credentials incoming message models with serialization support.
  • Extended FrontendMessageHandler to translate these messages into new FrontendHandlerEvent variants.
  • Added unit tests covering message parsing and handler event emission for both message types (with/without id).

Reviewed changes

Copilot reviewed 6 out of 6 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 new incoming message types for Matter/Thread external bus commands
app/src/main/kotlin/io/homeassistant/companion/android/frontend/handler/FrontendMessageHandler.kt Maps new incoming messages to handler events (and logs receipt)
app/src/main/kotlin/io/homeassistant/companion/android/frontend/handler/FrontendHandlerEvent.kt Introduces new handler events representing Matter commissioning + Thread credential import requests
app/src/main/kotlin/io/homeassistant/companion/android/frontend/FrontendViewModel.kt Adds placeholder handling that currently logs and does not complete the request
app/src/test/kotlin/io/homeassistant/companion/android/frontend/externalbus/incoming/IncomingExternalBusMessageTest.kt Adds JSON deserialization tests for the new message types
app/src/test/kotlin/io/homeassistant/companion/android/frontend/handler/FrontendMessageHandlerTest.kt Adds handler event emission tests for the new message types

@TimoPtr TimoPtr added the WebViewActivity replacement Ongoing work to replace the WebViewActivity in favor of a well tested compose screen using nav. label May 20, 2026
@TimoPtr TimoPtr force-pushed the feature/matter_external_bus_messages branch from e3e5707 to d2eab06 Compare May 28, 2026 11:48
@TimoPtr TimoPtr requested a review from jpelgrom May 28, 2026 11:49
@jpelgrom
Copy link
Copy Markdown
Member

After reviewing this and the bar code scanner PR, I guess my main question is how descriptive we want to be. I think I would summarize it as:

  • in incoming messages, it should only describe what the frontends wants the app to do and what it wants in return, not how the app does it internally or when it is sent unless it is part of a flow or only ever sent from one location
  • in frontend events, it should describe what the app should do and maybe a surface-level description of the implementation, but no specifics further than what is called from the frontend screens
  • in outgoing messages, it should only describe the data, not how it is collected as that is up to the part of the app that collects it

With that in mind, I think maybe the mention of Play Services should be dropped from the incoming messages. The frontend doesn't really care where it is coming from. The flow is only started from one place so describing when it is sent is OK here.

@jpelgrom jpelgrom changed the title Add incoming external bus messages for matter Add incoming external bus messages for Matter/Thread May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed WebViewActivity replacement Ongoing work to replace the WebViewActivity in favor of a well tested compose screen using nav.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants