Offer to remove statistics for entities with unsupported state class (#13325)

This commit is contained in:
Erik Montnemery 2022-08-02 13:12:05 +02:00 committed by GitHub
parent 0ab823bcf5
commit dac1d76bd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -281,7 +281,7 @@ class HaPanelDevStatistics extends SubscribeMixin(LitElement) {
});
break;
case "unsupported_state_class":
showAlertDialog(this, {
showConfirmationDialog(this, {
title: "Unsupported state class",
text: html`The state class of this entity, ${issue.data.state_class}
is not supported. <br />Statistics can not be generated until this
@ -296,7 +296,15 @@ class HaPanelDevStatistics extends SubscribeMixin(LitElement) {
rel="noreferrer noopener"
>
developer documentation</a
>.`,
>. If the state class has permanently changed, you may want to
remove the long term statistics of it from your database.<br /><br />Do
you want to permanently remove the long term statistics of
${issue.data.statistic_id} from your database?`,
confirmText: this.hass.localize("ui.common.remove"),
confirm: async () => {
await clearStatistics(this.hass, [issue.data.statistic_id]);
this._validateStatistics();
},
});
break;
case "unsupported_unit_metadata":