Tell mobile app to scan for Improv devices when 'Add Integration' tap (#21420)

This commit is contained in:
Bruno Pantaleão Gonçalves 2024-07-19 12:48:51 +02:00 committed by GitHub
parent 677cffd650
commit 7fed4e6b37
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 1 deletions

View File

@ -128,6 +128,9 @@ interface EMOutgoingMessageAssistShow extends EMMessage {
start_listening: boolean;
};
}
interface EMOutgoingMessageImprovScan extends EMMessage {
type: "improv/scan";
}
interface EMOutgoingMessageThreadStoreInPlatformKeychain extends EMMessage {
type: "thread/store_in_platform_keychain";
@ -156,7 +159,8 @@ type EMOutgoingMessageWithoutAnswer =
| EMOutgoingMessageSidebarShow
| EMOutgoingMessageTagWrite
| EMOutgoingMessageThemeUpdate
| EMOutgoingMessageThreadStoreInPlatformKeychain;
| EMOutgoingMessageThreadStoreInPlatformKeychain
| EMOutgoingMessageImprovScan;
interface EMIncomingMessageRestart {
id: number;
@ -252,6 +256,7 @@ export interface ExternalConfig {
canTransferThreadCredentialsToKeychain: boolean;
hasAssist: boolean;
hasBarCodeScanner: number;
canSetupImprov: boolean;
}
export class ExternalMessaging {

View File

@ -593,6 +593,11 @@ class HaConfigIntegrationsDashboard extends SubscribeMixin(LitElement) {
showAddIntegrationDialog(this, {
initialFilter: this._filter,
});
if (this.hass.auth.external?.config.canSetupImprov) {
this.hass.auth.external!.fireMessage({
type: "improv/scan",
});
}
}
private _handleMenuAction(ev: CustomEvent<ActionDetail>) {