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

View File

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