Show name on ignored entries (#8135)

This commit is contained in:
Paulus Schoutsen 2021-01-12 09:26:31 +01:00 committed by GitHub
parent aba0e1f026
commit cea3b8b010
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 4 deletions

View File

@ -51,8 +51,12 @@ export const handleConfigFlowStep = (
HEADERS HEADERS
); );
export const ignoreConfigFlow = (hass: HomeAssistant, flowId: string) => export const ignoreConfigFlow = (
hass.callWS({ type: "config_entries/ignore_flow", flow_id: flowId }); hass: HomeAssistant,
flowId: string,
title: string
) =>
hass.callWS({ type: "config_entries/ignore_flow", flow_id: flowId, title });
export const deleteConfigFlow = (hass: HomeAssistant, flowId: string) => export const deleteConfigFlow = (hass: HomeAssistant, flowId: string) =>
hass.callApi("DELETE", `config/config_entries/flow/${flowId}`); hass.callApi("DELETE", `config/config_entries/flow/${flowId}`);

View File

@ -338,7 +338,11 @@ class HaConfigIntegrations extends SubscribeMixin(LitElement) {
/> />
</div> </div>
<h2> <h2>
${item.localized_domain_name} ${// In 2020.2 we added support for item.title. All ignored entries before
// that have title "Ignored" so we fallback to localized domain name.
item.title === "Ignored"
? item.localized_domain_name
: item.title}
</h2> </h2>
<mwc-button <mwc-button
@click=${this._removeIgnoredIntegration} @click=${this._removeIgnoredIntegration}
@ -571,7 +575,11 @@ class HaConfigIntegrations extends SubscribeMixin(LitElement) {
if (!confirmed) { if (!confirmed) {
return; return;
} }
await ignoreConfigFlow(this.hass, flow.flow_id); await ignoreConfigFlow(
this.hass,
flow.flow_id,
localizeConfigFlowTitle(this.hass.localize, flow)
);
this._loadConfigEntries(); this._loadConfigEntries();
getConfigFlowInProgressCollection(this.hass.connection).refresh(); getConfigFlowInProgressCollection(this.hass.connection).refresh();
} }