mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Allow mobile apps to provide QR code functionality (#19570)
* Add QR code scanner to external bus * Make `hasQRScanner` a version number
This commit is contained in:
parent
8acae63939
commit
b728b9efc4
@ -35,6 +35,13 @@ interface EMOutgoingMessageConfigGet extends EMMessage {
|
||||
type: "config/get";
|
||||
}
|
||||
|
||||
interface EMOutgoingMessageScanQRCode extends EMMessage {
|
||||
type: "qr_code/scan";
|
||||
title: string;
|
||||
description: string;
|
||||
alternative_option_label?: string;
|
||||
}
|
||||
|
||||
interface EMOutgoingMessageMatterCommission extends EMMessage {
|
||||
type: "matter/commission";
|
||||
}
|
||||
@ -48,6 +55,13 @@ type EMOutgoingMessageWithAnswer = {
|
||||
request: EMOutgoingMessageConfigGet;
|
||||
response: ExternalConfig;
|
||||
};
|
||||
"qr_code/scan": {
|
||||
request: EMOutgoingMessageScanQRCode;
|
||||
response:
|
||||
| EMIncomingMessageQRCodeResponseCanceled
|
||||
| EMIncomingMessageQRCodeResponseAlternativeOptions
|
||||
| EMIncomingMessageQRCodeResponseScanResult;
|
||||
};
|
||||
};
|
||||
|
||||
interface EMOutgoingMessageExoplayerPlayHLS extends EMMessage {
|
||||
@ -158,6 +172,19 @@ interface EMIncomingMessageShowAutomationEditor {
|
||||
};
|
||||
}
|
||||
|
||||
export interface EMIncomingMessageQRCodeResponseCanceled {
|
||||
action: "canceled";
|
||||
}
|
||||
|
||||
export interface EMIncomingMessageQRCodeResponseAlternativeOptions {
|
||||
action: "alternative_options";
|
||||
}
|
||||
|
||||
export interface EMIncomingMessageQRCodeResponseScanResult {
|
||||
action: "scan_result";
|
||||
result: string;
|
||||
}
|
||||
|
||||
export type EMIncomingMessageCommands =
|
||||
| EMIncomingMessageRestart
|
||||
| EMIncomingMessageShowNotifications
|
||||
@ -180,6 +207,7 @@ export interface ExternalConfig {
|
||||
canCommissionMatter: boolean;
|
||||
canImportThreadCredentials: boolean;
|
||||
hasAssist: boolean;
|
||||
hasQRScanner: number;
|
||||
}
|
||||
|
||||
export class ExternalMessaging {
|
||||
|
Loading…
x
Reference in New Issue
Block a user