mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 11:16:35 +00:00
Allow config entries to show the reason (#8974)
This commit is contained in:
parent
c296a60bab
commit
3f21c87a3d
@ -39,6 +39,7 @@ const createConfigEntry = (
|
|||||||
supports_options: false,
|
supports_options: false,
|
||||||
supports_unload: true,
|
supports_unload: true,
|
||||||
disabled_by: null,
|
disabled_by: null,
|
||||||
|
reason: null,
|
||||||
...override,
|
...override,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -76,6 +77,10 @@ const migrationErrorEntry = createConfigEntry("Migration Error", {
|
|||||||
const setupRetryEntry = createConfigEntry("Setup Retry", {
|
const setupRetryEntry = createConfigEntry("Setup Retry", {
|
||||||
state: "setup_retry",
|
state: "setup_retry",
|
||||||
});
|
});
|
||||||
|
const setupRetryReasonEntry = createConfigEntry("Setup Retry", {
|
||||||
|
state: "setup_retry",
|
||||||
|
reason: "Unable to connect",
|
||||||
|
});
|
||||||
const failedUnloadEntry = createConfigEntry("Failed Unload", {
|
const failedUnloadEntry = createConfigEntry("Failed Unload", {
|
||||||
state: "failed_unload",
|
state: "failed_unload",
|
||||||
});
|
});
|
||||||
@ -135,6 +140,7 @@ const configEntries: Array<{
|
|||||||
{ items: [setupErrorEntry] },
|
{ items: [setupErrorEntry] },
|
||||||
{ items: [migrationErrorEntry] },
|
{ items: [migrationErrorEntry] },
|
||||||
{ items: [setupRetryEntry] },
|
{ items: [setupRetryEntry] },
|
||||||
|
{ items: [setupRetryReasonEntry] },
|
||||||
{ items: [failedUnloadEntry] },
|
{ items: [failedUnloadEntry] },
|
||||||
{ items: [notLoadedEntry] },
|
{ items: [notLoadedEntry] },
|
||||||
{
|
{
|
||||||
|
@ -16,6 +16,7 @@ export interface ConfigEntry {
|
|||||||
supports_options: boolean;
|
supports_options: boolean;
|
||||||
supports_unload: boolean;
|
supports_unload: boolean;
|
||||||
disabled_by: "user" | null;
|
disabled_by: "user" | null;
|
||||||
|
reason: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ConfigEntryMutableParams {
|
export interface ConfigEntryMutableParams {
|
||||||
|
@ -199,7 +199,9 @@ export class HaIntegrationCard extends LitElement {
|
|||||||
stateText = [
|
stateText = [
|
||||||
`ui.panel.config.integrations.config_entry.state.${item.state}`,
|
`ui.panel.config.integrations.config_entry.state.${item.state}`,
|
||||||
];
|
];
|
||||||
stateTextExtra = html`
|
stateTextExtra = item.reason
|
||||||
|
? html`: ${item.reason}`
|
||||||
|
: html`
|
||||||
<br />
|
<br />
|
||||||
<a href="/config/logs"
|
<a href="/config/logs"
|
||||||
>${this.hass.localize(
|
>${this.hass.localize(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user