mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Add import thread credentials to external bus (#18777)
This commit is contained in:
parent
d8d4ecf79f
commit
1eb25f4829
@ -37,6 +37,10 @@ interface EMOutgoingMessageMatterCommission extends EMMessage {
|
||||
type: "matter/commission";
|
||||
}
|
||||
|
||||
interface EMOutgoingMessageImportThreadCredentials extends EMMessage {
|
||||
type: "thread/import_credentials";
|
||||
}
|
||||
|
||||
type EMOutgoingMessageWithAnswer = {
|
||||
"config/get": {
|
||||
request: EMOutgoingMessageConfigGet;
|
||||
@ -116,7 +120,8 @@ type EMOutgoingMessageWithoutAnswer =
|
||||
| EMOutgoingMessageThemeUpdate
|
||||
| EMMessageResultSuccess
|
||||
| EMMessageResultError
|
||||
| EMOutgoingMessageMatterCommission;
|
||||
| EMOutgoingMessageMatterCommission
|
||||
| EMOutgoingMessageImportThreadCredentials;
|
||||
|
||||
interface EMIncomingMessageRestart {
|
||||
id: number;
|
||||
@ -161,6 +166,7 @@ export interface ExternalConfig {
|
||||
canWriteTag: boolean;
|
||||
hasExoPlayer: boolean;
|
||||
canCommissionMatter: boolean;
|
||||
canImportThreadCredentials: boolean;
|
||||
hasAssist: boolean;
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,14 @@ import {
|
||||
mdiInformationOutline,
|
||||
mdiCellphoneKey,
|
||||
} from "@mdi/js";
|
||||
import { LitElement, PropertyValues, TemplateResult, css, html } from "lit";
|
||||
import {
|
||||
LitElement,
|
||||
PropertyValues,
|
||||
TemplateResult,
|
||||
css,
|
||||
html,
|
||||
nothing,
|
||||
} from "lit";
|
||||
import { customElement, property, state } from "lit/decorators";
|
||||
import memoizeOne from "memoize-one";
|
||||
import { isComponentLoaded } from "../../../../../common/config/is_component_loaded";
|
||||
@ -132,6 +139,15 @@ export class ThreadConfigPanel extends SubscribeMixin(LitElement) {
|
||||
)}`
|
||||
: ""}
|
||||
</div>
|
||||
${this.hass.auth.external?.config.canImportThreadCredentials
|
||||
? html`<ha-fab
|
||||
slot="fab"
|
||||
@click=${this._importExternalThreadCredentials}
|
||||
extended
|
||||
label="Import credentials"
|
||||
><ha-svg-icon slot="icon" .path=${mdiCellphoneKey}></ha-svg-icon
|
||||
></ha-fab>`
|
||||
: nothing}
|
||||
</hass-subpage>
|
||||
`;
|
||||
}
|
||||
@ -313,6 +329,12 @@ export class ThreadConfigPanel extends SubscribeMixin(LitElement) {
|
||||
});
|
||||
}
|
||||
|
||||
private _importExternalThreadCredentials() {
|
||||
this.hass.auth.external!.fireMessage({
|
||||
type: "thread/import_credentials",
|
||||
});
|
||||
}
|
||||
|
||||
private _onImageError(ev) {
|
||||
ev.target.style.display = "none";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user