mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +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";
|
type: "matter/commission";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface EMOutgoingMessageImportThreadCredentials extends EMMessage {
|
||||||
|
type: "thread/import_credentials";
|
||||||
|
}
|
||||||
|
|
||||||
type EMOutgoingMessageWithAnswer = {
|
type EMOutgoingMessageWithAnswer = {
|
||||||
"config/get": {
|
"config/get": {
|
||||||
request: EMOutgoingMessageConfigGet;
|
request: EMOutgoingMessageConfigGet;
|
||||||
@ -116,7 +120,8 @@ type EMOutgoingMessageWithoutAnswer =
|
|||||||
| EMOutgoingMessageThemeUpdate
|
| EMOutgoingMessageThemeUpdate
|
||||||
| EMMessageResultSuccess
|
| EMMessageResultSuccess
|
||||||
| EMMessageResultError
|
| EMMessageResultError
|
||||||
| EMOutgoingMessageMatterCommission;
|
| EMOutgoingMessageMatterCommission
|
||||||
|
| EMOutgoingMessageImportThreadCredentials;
|
||||||
|
|
||||||
interface EMIncomingMessageRestart {
|
interface EMIncomingMessageRestart {
|
||||||
id: number;
|
id: number;
|
||||||
@ -161,6 +166,7 @@ export interface ExternalConfig {
|
|||||||
canWriteTag: boolean;
|
canWriteTag: boolean;
|
||||||
hasExoPlayer: boolean;
|
hasExoPlayer: boolean;
|
||||||
canCommissionMatter: boolean;
|
canCommissionMatter: boolean;
|
||||||
|
canImportThreadCredentials: boolean;
|
||||||
hasAssist: boolean;
|
hasAssist: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,14 @@ import {
|
|||||||
mdiInformationOutline,
|
mdiInformationOutline,
|
||||||
mdiCellphoneKey,
|
mdiCellphoneKey,
|
||||||
} from "@mdi/js";
|
} 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 { customElement, property, state } from "lit/decorators";
|
||||||
import memoizeOne from "memoize-one";
|
import memoizeOne from "memoize-one";
|
||||||
import { isComponentLoaded } from "../../../../../common/config/is_component_loaded";
|
import { isComponentLoaded } from "../../../../../common/config/is_component_loaded";
|
||||||
@ -132,6 +139,15 @@ export class ThreadConfigPanel extends SubscribeMixin(LitElement) {
|
|||||||
)}`
|
)}`
|
||||||
: ""}
|
: ""}
|
||||||
</div>
|
</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>
|
</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) {
|
private _onImageError(ev) {
|
||||||
ev.target.style.display = "none";
|
ev.target.style.display = "none";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user