mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 19:26:36 +00:00
Remove default commission buttons on Matter config panel (#15304)Co-authored-by: Bram Kragten <mail@bramkragten.nl>
* remove default commission buttons * Update matter-config-panel.ts * only show for dev versions --------- Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
parent
4bce4152d3
commit
7e7c6aa053
@ -22,3 +22,11 @@ export const atLeastVersion = (
|
|||||||
Number(haPatch) >= patch)
|
Number(haPatch) >= patch)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const isDevVersion = (version: string): boolean => {
|
||||||
|
if (__DEMO__) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return version.includes("dev");
|
||||||
|
};
|
||||||
|
@ -15,6 +15,7 @@ import "../../../../../components/ha-alert";
|
|||||||
import { showPromptDialog } from "../../../../../dialogs/generic/show-dialog-box";
|
import { showPromptDialog } from "../../../../../dialogs/generic/show-dialog-box";
|
||||||
import { navigate } from "../../../../../common/navigate";
|
import { navigate } from "../../../../../common/navigate";
|
||||||
import { isComponentLoaded } from "../../../../../common/config/is_component_loaded";
|
import { isComponentLoaded } from "../../../../../common/config/is_component_loaded";
|
||||||
|
import { isDevVersion } from "../../../../../common/config/version";
|
||||||
|
|
||||||
@customElement("matter-config-panel")
|
@customElement("matter-config-panel")
|
||||||
export class MatterConfigPanel extends LitElement {
|
export class MatterConfigPanel extends LitElement {
|
||||||
@ -61,15 +62,19 @@ export class MatterConfigPanel extends LitElement {
|
|||||||
>Commission device with mobile app</mwc-button
|
>Commission device with mobile app</mwc-button
|
||||||
>`
|
>`
|
||||||
: ""}
|
: ""}
|
||||||
|
${isDevVersion(this.hass.config.version)
|
||||||
|
? html`<mwc-button @click=${this._commission}
|
||||||
|
>Commission device</mwc-button
|
||||||
|
>
|
||||||
|
<mwc-button @click=${this._acceptSharedDevice}
|
||||||
|
>Add shared device</mwc-button
|
||||||
|
>`
|
||||||
|
: ""}
|
||||||
<mwc-button @click=${this._setWifi}
|
<mwc-button @click=${this._setWifi}
|
||||||
>Set WiFi Credentials</mwc-button
|
>Set WiFi Credentials</mwc-button
|
||||||
>
|
>
|
||||||
<mwc-button @click=${this._setThread}>Set Thread</mwc-button>
|
<mwc-button @click=${this._setThread}
|
||||||
<mwc-button @click=${this._commission}
|
>Set Thread Credentials</mwc-button
|
||||||
>Commission device</mwc-button
|
|
||||||
>
|
|
||||||
<mwc-button @click=${this._acceptSharedDevice}
|
|
||||||
>Add shared device</mwc-button
|
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</ha-card>
|
</ha-card>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user