mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +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";
|
type: "config/get";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface EMOutgoingMessageScanQRCode extends EMMessage {
|
||||||
|
type: "qr_code/scan";
|
||||||
|
title: string;
|
||||||
|
description: string;
|
||||||
|
alternative_option_label?: string;
|
||||||
|
}
|
||||||
|
|
||||||
interface EMOutgoingMessageMatterCommission extends EMMessage {
|
interface EMOutgoingMessageMatterCommission extends EMMessage {
|
||||||
type: "matter/commission";
|
type: "matter/commission";
|
||||||
}
|
}
|
||||||
@ -48,6 +55,13 @@ type EMOutgoingMessageWithAnswer = {
|
|||||||
request: EMOutgoingMessageConfigGet;
|
request: EMOutgoingMessageConfigGet;
|
||||||
response: ExternalConfig;
|
response: ExternalConfig;
|
||||||
};
|
};
|
||||||
|
"qr_code/scan": {
|
||||||
|
request: EMOutgoingMessageScanQRCode;
|
||||||
|
response:
|
||||||
|
| EMIncomingMessageQRCodeResponseCanceled
|
||||||
|
| EMIncomingMessageQRCodeResponseAlternativeOptions
|
||||||
|
| EMIncomingMessageQRCodeResponseScanResult;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
interface EMOutgoingMessageExoplayerPlayHLS extends EMMessage {
|
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 =
|
export type EMIncomingMessageCommands =
|
||||||
| EMIncomingMessageRestart
|
| EMIncomingMessageRestart
|
||||||
| EMIncomingMessageShowNotifications
|
| EMIncomingMessageShowNotifications
|
||||||
@ -180,6 +207,7 @@ export interface ExternalConfig {
|
|||||||
canCommissionMatter: boolean;
|
canCommissionMatter: boolean;
|
||||||
canImportThreadCredentials: boolean;
|
canImportThreadCredentials: boolean;
|
||||||
hasAssist: boolean;
|
hasAssist: boolean;
|
||||||
|
hasQRScanner: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ExternalMessaging {
|
export class ExternalMessaging {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user