diff --git a/src/data/recorder.ts b/src/data/recorder.ts
index f4ab0cb804..1b89af2834 100644
--- a/src/data/recorder.ts
+++ b/src/data/recorder.ts
@@ -50,7 +50,7 @@ export interface StatisticsMetaData {
export const STATISTIC_TYPES: StatisticsValidationResult["type"][] = [
"entity_not_recorded",
"entity_no_longer_recorded",
- "unsupported_state_class",
+ "state_class_removed",
"units_changed",
"no_state",
];
@@ -59,7 +59,7 @@ export type StatisticsValidationResult =
| StatisticsValidationResultNoState
| StatisticsValidationResultEntityNotRecorded
| StatisticsValidationResultEntityNoLongerRecorded
- | StatisticsValidationResultUnsupportedStateClass
+ | StatisticsValidationResultStateClassRemoved
| StatisticsValidationResultUnitsChanged;
export interface StatisticsValidationResultNoState {
@@ -77,9 +77,9 @@ export interface StatisticsValidationResultEntityNotRecorded {
data: { statistic_id: string };
}
-export interface StatisticsValidationResultUnsupportedStateClass {
- type: "unsupported_state_class";
- data: { statistic_id: string; state_class: string };
+export interface StatisticsValidationResultStateClassRemoved {
+ type: "state_class_removed";
+ data: { statistic_id: string };
}
export interface StatisticsValidationResultUnitsChanged {
diff --git a/src/panels/developer-tools/statistics/developer-tools-statistics.ts b/src/panels/developer-tools/statistics/developer-tools-statistics.ts
index a169eeb179..8baafaf909 100644
--- a/src/panels/developer-tools/statistics/developer-tools-statistics.ts
+++ b/src/panels/developer-tools/statistics/developer-tools-statistics.ts
@@ -26,7 +26,7 @@ const FIX_ISSUES_ORDER = {
no_state: 0,
entity_no_longer_recorded: 1,
entity_not_recorded: 1,
- unsupported_state_class: 2,
+ state_class_removed: 2,
units_changed: 3,
};
@@ -273,11 +273,9 @@ class HaPanelDevStatistics extends SubscribeMixin(LitElement) {
);
if (
result &&
- [
- "no_state",
- "entity_no_longer_recorded",
- "unsupported_state_class",
- ].includes(issue.type)
+ ["no_state", "entity_no_longer_recorded", "state_class_removed"].includes(
+ issue.type
+ )
) {
this._deletedStatistics.add(issue.data.statistic_id);
}
diff --git a/src/panels/developer-tools/statistics/fix-statistics.ts b/src/panels/developer-tools/statistics/fix-statistics.ts
index 8dd140e718..0329cf77be 100644
--- a/src/panels/developer-tools/statistics/fix-statistics.ts
+++ b/src/panels/developer-tools/statistics/fix-statistics.ts
@@ -103,31 +103,30 @@ export const fixStatisticsIssue = async (
await clearStatistics(hass, [issue.data.statistic_id]);
},
});
- case "unsupported_state_class":
+ case "state_class_removed":
return showConfirmationDialog(element, {
title: localize(
- "ui.panel.developer-tools.tabs.statistics.fix_issue.unsupported_state_class.title"
+ "ui.panel.developer-tools.tabs.statistics.fix_issue.state_class_removed.title"
),
text: html`${localize(
- "ui.panel.developer-tools.tabs.statistics.fix_issue.unsupported_state_class.info_text_1",
+ "ui.panel.developer-tools.tabs.statistics.fix_issue.state_class_removed.info_text_1",
{
name: getStatisticLabel(hass, issue.data.statistic_id, undefined),
statistic_id: issue.data.statistic_id,
- state_class: issue.data.state_class,
}
)}
${localize(
- "ui.panel.developer-tools.tabs.statistics.fix_issue.unsupported_state_class.info_text_2"
+ "ui.panel.developer-tools.tabs.statistics.fix_issue.state_class_removed.info_text_2"
)}