@@ -87,6 +87,12 @@ export class DialogStatisticsFixUnsupportedUnitMetadata extends LitElement {
8787 this . _open = false ;
8888 }
8989
90+ private _adjustDataAndCloseInputDialog ( ) : void {
91+ fireEvent ( this , "dialog-closed" , { dialog : this . localName } ) ;
92+ this . _clearChosenStatistic ( ) ;
93+ this . _fetchStats ( ) ;
94+ }
95+
9096 private _dialogClosed ( ) : void {
9197 this . _open = false ;
9298 this . _params = undefined ;
@@ -97,7 +103,6 @@ export class DialogStatisticsFixUnsupportedUnitMetadata extends LitElement {
97103 this . _amount = undefined ;
98104 this . _chosenStat = undefined ;
99105 this . _busy = false ;
100- fireEvent ( this , "dialog-closed" , { dialog : this . localName } ) ;
101106 }
102107
103108 protected render ( ) {
@@ -120,7 +125,7 @@ export class DialogStatisticsFixUnsupportedUnitMetadata extends LitElement {
120125 "ui.panel.config.developer-tools.tabs.statistics.fix_issue.adjust_sum.outliers"
121126 ) }
122127 </ ha- butto n>
123- <ha- butto n slot= "primaryAction" data-dialog = "close" >
128+ <ha- butto n slot= "primaryAction" @click = ${ this . closeDialog } >
124129 ${ this . hass . localize ( "ui.common.close" ) }
125130 </ ha- butto n>
126131 ` ;
@@ -482,6 +487,7 @@ export class DialogStatisticsFixUnsupportedUnitMetadata extends LitElement {
482487 this . _amount ! - this . _origAmount ! ,
483488 unit || null
484489 ) ;
490+ this . _busy = false ;
485491 } catch ( err : any ) {
486492 this . _busy = false ;
487493 showAlertDialog ( this , {
@@ -497,7 +503,7 @@ export class DialogStatisticsFixUnsupportedUnitMetadata extends LitElement {
497503 "ui.panel.config.developer-tools.tabs.statistics.fix_issue.adjust_sum.sum_adjusted"
498504 ) ,
499505 } ) ;
500- this . closeDialog ( ) ;
506+ this . _adjustDataAndCloseInputDialog ( ) ;
501507 }
502508
503509 static get styles ( ) : CSSResultGroup {
0 commit comments