Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add statistic id to statistic issue fix messages #22104

Merged
merged 2 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
3 changes: 3 additions & 0 deletions 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 @@ -110,6 +112,7 @@ export const fixStatisticsIssue = async (
"ui.panel.developer-tools.tabs.statistics.fix_issue.unsupported_state_class.info_text_1",
{
name: getStatisticLabel(hass, issue.data.statistic_id, undefined),
statistic_id: issue.data.statistic_id,
state_class: issue.data.state_class,
}
)}<br /><br />
Expand Down
10 changes: 5 additions & 5 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -6961,25 +6961,25 @@
},
"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_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 +6992,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
Loading