Add incoming external bus messages for Matter/Thread#6872
Conversation
There was a problem hiding this comment.
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/commissionandthread/import_credentialsincoming message models with serialization support. - Extended
FrontendMessageHandlerto translate these messages into newFrontendHandlerEventvariants. - 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 |
e3e5707 to
d2eab06
Compare
|
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:
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. |
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