Skip to content

Commit

Permalink
Add statistic id to fix messages
Browse files Browse the repository at this point in the history
  • Loading branch information
bramkragten committed Sep 26, 2024
1 parent 500bc95 commit f86ef70
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export class DialogStatisticsFixUnitsChanged extends LitElement {
this._params.issue.data.statistic_id,
undefined
),
statistic_id: this._params.issue.data.statistic_id,
current_unit: this._params.issue.data.state_unit,
previous_unit: this._params.issue.data.metadata_unit,
}
Expand Down
7 changes: 6 additions & 1 deletion src/panels/developer-tools/statistics/fix-statistics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const fixStatisticsIssue = async (
"ui.panel.developer-tools.tabs.statistics.fix_issue.no_state.info_text_1",
{
name: getStatisticLabel(hass, issue.data.statistic_id, undefined),
statistic_id: issue.data.statistic_id,
}
)}<br /><br />${localize(
"ui.panel.developer-tools.tabs.statistics.fix_issue.no_state.info_text_2",
Expand Down Expand Up @@ -75,6 +76,7 @@ export const fixStatisticsIssue = async (
"ui.panel.developer-tools.tabs.statistics.fix_issue.entity_no_longer_recorded.info_text_1",
{
name: getStatisticLabel(hass, issue.data.statistic_id, undefined),
statistic_id: issue.data.statistic_id,
}
)}
${localize(
Expand Down Expand Up @@ -107,9 +109,12 @@ export const fixStatisticsIssue = async (
"ui.panel.developer-tools.tabs.statistics.fix_issue.unsupported_state_class.title"
),
text: html`${localize(
"ui.panel.developer-tools.tabs.statistics.fix_issue.unsupported_state_class.info_text_1",
issue.data.state_class
? "ui.panel.developer-tools.tabs.statistics.fix_issue.unsupported_state_class.info_text_1"
: "ui.panel.developer-tools.tabs.statistics.fix_issue.unsupported_state_class.info_text_1_no_state_class",
{
name: getStatisticLabel(hass, issue.data.statistic_id, undefined),
statistic_id: issue.data.statistic_id,
state_class: issue.data.state_class,
}
)}<br /><br />
Expand Down
11 changes: 6 additions & 5 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -6961,25 +6961,26 @@
},
"no_state": {
"title": "Entity has no state",
"info_text_1": "{name} has no state at the moment, if this is an orphaned entity, you may want to delete the long term statistics of it from your database.",
"info_text_1": "''{name}'' ({statistic_id}) has no state at the moment, if this is an orphaned entity, you may want to delete the long term statistics of it from your database.",
"info_text_2": "Do you want to permanently delete the long term statistics of {statistic_id} from your database?"
},
"entity_not_recorded": {
"title": "Entity is not recorded",
"info_text_1": "State changes of {name} are not recorded, therefore, we cannot track long term statistics for it.",
"info_text_1": "State changes of ''{name}'' ({statistic_id}) are not recorded, therefore, we cannot track long term statistics for it.",
"info_text_2": "You probably excluded this entity, or have just included some entities.",
"info_text_3_link": "See the recorder documentation for more information."
},
"entity_no_longer_recorded": {
"title": "Entity is no longer recorded",
"info_text_1": "We have generated statistics for {name} in the past, but state changes of this entity are no longer recorded, therefore, we cannot track long term statistics for it anymore.",
"info_text_1": "We have generated statistics for ''{name}'' ({statistic_id}) in the past, but state changes of this entity are no longer recorded, therefore, we cannot track long term statistics for it anymore.",
"info_text_2": "You probably excluded this entity, or have just included some entities.",
"info_text_3_link": "See the recorder documentation for more information.",
"info_text_4": "If you no longer wish to keep the long term statistics recorded in the past, you may delete them now."
},
"unsupported_state_class": {
"title": "Unsupported state class",
"info_text_1": "The state class of {name}, ''{state_class}'', is not supported.",
"info_text_1": "The state class of ''{name}'' ({statistic_id}), ''{state_class}'', is not supported.",
"info_text_1_no_state_class": "''{name}'' ({statistic_id}), has no state class.",
"info_text_2": "Statistics cannot be generated until this entity has a supported state class.",
"info_text_3": "If this state class was provided by an integration, this is a bug. Please report an issue.",
"info_text_4": "If you have set this state class yourself, please correct it.",
Expand All @@ -6992,7 +6993,7 @@
"update": "Update the unit of the historic statistic values from ''{metadata_unit}'' to ''{state_unit}'', without converting.",
"clear": "Delete all old statistic data for this entity",
"how_to_fix": "How do you want to fix this issue?",
"info_text_1": "The unit of {name} changed to ''{current_unit}'' which can't be converted to the previously stored unit, ''{previous_unit}''.",
"info_text_1": "The unit of ''{name}'' ({statistic_id}) changed to ''{current_unit}'' which can't be converted to the previously stored unit, ''{previous_unit}''.",
"info_text_2": "If the historic statistic values have a wrong unit, you can update the units of the old values. The values will not be updated.",
"info_text_3": "Otherwise you can choose to delete all historic statistic values, and start over."
},
Expand Down

0 comments on commit f86ef70

Please sign in to comment.