Skip to content

Commit

Permalink
Use new manifest option name
Browse files Browse the repository at this point in the history
  • Loading branch information
jpbede committed Feb 12, 2024
1 parent daa0d6b commit b0ab460
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/data/integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export interface IntegrationManifest {
| "cloud_push"
| "local_polling"
| "local_push";
single_instance_only?: boolean;
single_config_entry?: boolean;
}
export interface IntegrationSetup {
domain: string;
Expand Down
2 changes: 1 addition & 1 deletion src/data/integrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface Integration {
iot_class?: string;
supported_by?: string;
is_built_in?: boolean;
single_instance_only?: boolean;
single_config_entry?: boolean;
}

export interface Integrations {
Expand Down
6 changes: 3 additions & 3 deletions src/panels/config/integrations/dialog-add-integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export interface IntegrationListItem {
cloud?: boolean;
is_built_in?: boolean;
is_add?: boolean;
single_instance_only?: boolean;
single_config_entry?: boolean;
}

@customElement("dialog-add-integration")
Expand Down Expand Up @@ -211,7 +211,7 @@ class AddIntegrationDialog extends LitElement {
supported_by: integration.supported_by,
is_built_in: supportedIntegration.is_built_in !== false,
cloud: supportedIntegration.iot_class?.startsWith("cloud_"),
single_instance_only: integration.single_instance_only,
single_config_entry: integration.single_config_entry,
});
} else if (
!("integration_type" in integration) &&
Expand Down Expand Up @@ -576,7 +576,7 @@ class AddIntegrationDialog extends LitElement {
return;
}

if (integration.single_instance_only) {
if (integration.single_config_entry) {
const configEntries = await getConfigEntries(this.hass, {
domain: integration.domain,
});
Expand Down
4 changes: 2 additions & 2 deletions src/panels/config/integrations/dialog-single-instance-only.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ export class DialogSingleInstanceOnly extends LitElement {
open
@closed=${this.closeDialog}
.heading=${this.hass.localize(
"ui.panel.config.integrations.config_flow.single_instance_only_title"
"ui.panel.config.integrations.config_flow.single_config_entry_title"
)}
>
<p>
${this.hass.localize(
"ui.panel.config.integrations.config_flow.single_instance_only",
"ui.panel.config.integrations.config_flow.single_config_entry",
{
integration_name: this._params.integration.name,
}
Expand Down
4 changes: 2 additions & 2 deletions src/panels/config/integrations/ha-config-integration-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -504,11 +504,11 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
${normalEntries.map((item) => this._renderConfigEntry(item))}
</mwc-list>
<div class="card-actions">
${this._manifest?.single_instance_only &&
${this._manifest?.single_config_entry &&
this.configEntries.length > 0
? html`<ha-alert alert-type="info"
>${this.hass.localize(
`ui.panel.config.integrations.integration_page.single_instance_only`
`ui.panel.config.integrations.integration_page.single_config_entry_only`

Check failure on line 511 in src/panels/config/integrations/ha-config-integration-page.ts

View workflow job for this annotation

GitHub Actions / Lint and check format

Argument of type '"ui.panel.config.integrations.integration_page.single_config_entry_only"' is not assignable to parameter of type 'LocalizeKeys'.
)}</ha-alert
>`
: html`<ha-button @click=${this._addIntegration}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ class HaConfigIntegrationsDashboard extends SubscribeMixin(LitElement) {
const integration = findIntegration(integrations, domain);

if (integration?.config_flow) {
if (integration.single_instance_only) {
if (integration.single_config_entry) {
const configEntries = await getConfigEntries(this.hass, { domain });
if (configEntries.length > 0) {
showSingleInstanceOnlyDialog(this, { integration });
Expand Down
6 changes: 3 additions & 3 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3870,7 +3870,7 @@
"add_hardware": "Add hardware",
"add_entity": "[%key:ui::panel::config::integrations::integration_page::add_entry%]",
"add_system": "[%key:ui::panel::config::integrations::integration_page::add_entry%]",
"single_instance_only": "This integration allows only one configuration"
"single_config_entry": "This integration allows only one configuration"
},
"config_entry": {
"application_credentials": {
Expand Down Expand Up @@ -3980,8 +3980,8 @@
"matter_mobile_app": "You need to use the Home Assistant Companion app on your mobile phone to commission Matter devices.",
"supported_hardware": "supported hardware",
"proceed": "Proceed",
"single_instance_only_title": "This integration allows only one configuration",
"single_instance_only": "The {integration_name} supports only one configuration. Adding additional ones is not needed."
"single_config_entry_title": "This integration allows only one configuration",
"single_config_entry": "The {integration_name} supports only one configuration. Adding additional ones is not needed."
}
},
"users": {
Expand Down

0 comments on commit b0ab460

Please sign in to comment.