mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-09 18:36:35 +00:00
Filter out homekit and matter iot standards (#13985)
* Filter out homekit and matter iot standards * add divider between discovered * Update dialog-add-integration.ts * Update ha-domain-integrations.ts * Update en.json * Change headers * update styling * translation
This commit is contained in:
parent
37394f7bc5
commit
8eddaa1914
@ -639,21 +639,6 @@ class HaConfigAreaPage extends SubscribeMixin(LitElement) {
|
||||
return [
|
||||
haStyle,
|
||||
css`
|
||||
h1 {
|
||||
margin: 0;
|
||||
font-family: var(--paper-font-headline_-_font-family);
|
||||
-webkit-font-smoothing: var(
|
||||
--paper-font-headline_-_-webkit-font-smoothing
|
||||
);
|
||||
font-size: var(--paper-font-headline_-_font-size);
|
||||
font-weight: var(--paper-font-headline_-_font-weight);
|
||||
letter-spacing: var(--paper-font-headline_-_letter-spacing);
|
||||
line-height: var(--paper-font-headline_-_line-height);
|
||||
opacity: var(--dark-primary-opacity);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
h3 {
|
||||
margin: 0;
|
||||
padding: 0 16px;
|
||||
|
@ -187,12 +187,7 @@ class AddIntegrationDialog extends LitElement {
|
||||
|
||||
for (const [domain, domainBrands] of Object.entries(sb)) {
|
||||
const integration = this._findIntegration(domain);
|
||||
if (
|
||||
!integration ||
|
||||
(!integration.config_flow &&
|
||||
!integration.iot_standards &&
|
||||
!integration.integrations)
|
||||
) {
|
||||
if (!integration) {
|
||||
continue;
|
||||
}
|
||||
for (const [slug, name] of Object.entries(domainBrands)) {
|
||||
|
@ -36,7 +36,9 @@ class HaDomainIntegrations extends LitElement {
|
||||
protected render() {
|
||||
return html`<mwc-list>
|
||||
${this.flowsInProgress?.length
|
||||
? html`<h3>We discovered the following:</h3>
|
||||
? html`<h3>
|
||||
${this.hass.localize("ui.panel.config.integrations.discovered")}
|
||||
</h3>
|
||||
${this.flowsInProgress.map(
|
||||
(flow) => html`<mwc-list-item
|
||||
graphic="medium"
|
||||
@ -60,36 +62,46 @@ class HaDomainIntegrations extends LitElement {
|
||||
>
|
||||
<ha-icon-next slot="meta"></ha-icon-next>
|
||||
</mwc-list-item>`
|
||||
)}`
|
||||
)}
|
||||
<li divider role="separator"></li>
|
||||
${this.integration?.integrations
|
||||
? html`<h3>
|
||||
${this.hass.localize(
|
||||
"ui.panel.config.integrations.available_integrations"
|
||||
)}
|
||||
</h3>`
|
||||
: ""}`
|
||||
: ""}
|
||||
${this.integration?.iot_standards
|
||||
? this.integration.iot_standards.map((standard) => {
|
||||
const domain: string = standardToDomain[standard] || standard;
|
||||
return html`<mwc-list-item
|
||||
graphic="medium"
|
||||
.domain=${domain}
|
||||
@click=${this._standardPicked}
|
||||
hasMeta
|
||||
>
|
||||
<img
|
||||
slot="graphic"
|
||||
loading="lazy"
|
||||
src=${brandsUrl({
|
||||
domain,
|
||||
type: "icon",
|
||||
useFallback: true,
|
||||
darkOptimized: this.hass.themes?.darkMode,
|
||||
})}
|
||||
referrerpolicy="no-referrer"
|
||||
/>
|
||||
<span
|
||||
>${this.hass.localize(
|
||||
`ui.panel.config.integrations.add_${domain}_device`
|
||||
)}</span
|
||||
? this.integration.iot_standards
|
||||
.filter((standard) => standard in standardToDomain)
|
||||
.map((standard) => {
|
||||
const domain: string = standardToDomain[standard];
|
||||
return html`<mwc-list-item
|
||||
graphic="medium"
|
||||
.domain=${domain}
|
||||
@click=${this._standardPicked}
|
||||
hasMeta
|
||||
>
|
||||
<ha-icon-next slot="meta"></ha-icon-next>
|
||||
</mwc-list-item>`;
|
||||
})
|
||||
<img
|
||||
slot="graphic"
|
||||
loading="lazy"
|
||||
src=${brandsUrl({
|
||||
domain,
|
||||
type: "icon",
|
||||
useFallback: true,
|
||||
darkOptimized: this.hass.themes?.darkMode,
|
||||
})}
|
||||
referrerpolicy="no-referrer"
|
||||
/>
|
||||
<span
|
||||
>${this.hass.localize(
|
||||
`ui.panel.config.integrations.add_${domain}_device`
|
||||
)}</span
|
||||
>
|
||||
<ha-icon-next slot="meta"></ha-icon-next>
|
||||
</mwc-list-item>`;
|
||||
})
|
||||
: ""}
|
||||
${this.integration?.integrations
|
||||
? Object.entries(this.integration.integrations)
|
||||
@ -155,9 +167,11 @@ class HaDomainIntegrations extends LitElement {
|
||||
@click=${this._integrationPicked}
|
||||
hasMeta
|
||||
>
|
||||
Setup another instance of
|
||||
${this.integration.name ||
|
||||
domainToName(this.hass.localize, this.domain)}
|
||||
${this.hass.localize("ui.panel.config.integrations.new_flow", {
|
||||
integration:
|
||||
this.integration.name ||
|
||||
domainToName(this.hass.localize, this.domain),
|
||||
})}
|
||||
<ha-icon-next slot="meta"></ha-icon-next>
|
||||
</mwc-list-item>`
|
||||
: html`<ha-integration-list-item
|
||||
@ -272,16 +286,25 @@ class HaDomainIntegrations extends LitElement {
|
||||
css`
|
||||
:host {
|
||||
display: block;
|
||||
--mdc-list-item-graphic-size: 40px;
|
||||
--mdc-list-side-padding: 24px;
|
||||
}
|
||||
h3 {
|
||||
margin: 0 24px;
|
||||
color: var(--primary-text-color);
|
||||
margin: 8px 24px 0;
|
||||
color: var(--secondary-text-color);
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
}
|
||||
h3:first-of-type {
|
||||
margin-top: 0;
|
||||
}
|
||||
img {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
li[divider] {
|
||||
margin-top: 8px;
|
||||
}
|
||||
`,
|
||||
];
|
||||
}
|
||||
|
@ -104,8 +104,8 @@ export class HaIntegrationListItem extends ListItemBase {
|
||||
styles,
|
||||
css`
|
||||
:host {
|
||||
padding-left: var(--mdc-list-side-padding, 20px);
|
||||
padding-right: var(--mdc-list-side-padding, 20px);
|
||||
--mdc-list-side-padding: 24px;
|
||||
--mdc-list-item-graphic-size: 40px;
|
||||
}
|
||||
:host([graphic="avatar"]:not([twoLine])),
|
||||
:host([graphic="icon"]:not([twoLine])) {
|
||||
|
@ -2850,6 +2850,8 @@
|
||||
"description": "Manage integrations with services or devices",
|
||||
"integration": "integration",
|
||||
"discovered": "Discovered",
|
||||
"available_integrations": "Available integrations",
|
||||
"new_flow": "Setup another instance of {integration}",
|
||||
"attention": "Attention required",
|
||||
"configured": "Configured",
|
||||
"new": "Select brand",
|
||||
@ -2973,12 +2975,8 @@
|
||||
"description": "This step requires you to visit an external website to be completed.",
|
||||
"open_site": "Open website"
|
||||
},
|
||||
"pick_flow_step": {
|
||||
"title": "We discovered these, want to set them up?",
|
||||
"new_flow": "No, set up an other instance of {integration}"
|
||||
},
|
||||
"loading": {
|
||||
"loading_flow": "Please wait while {integration} is being setup",
|
||||
"loading_flow": "Please wait, starting configuration wizard for {integration}",
|
||||
"loading_step": "Loading next step for {integration}",
|
||||
"fallback_title": "the integration"
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user