@@ -122,7 +122,7 @@ class MiniGraphCard extends LitElement {
122
122
! entity . entity . startsWith ( 'binary_sensor.' ) , // turn off for binary sensor by default
123
123
) ,
124
124
logarithmic : this . config . logarithmic ,
125
- valueMultipler : ( entity . value_multipler ? entity . value_multipler : 1 )
125
+ scaleFactor : ( entity . scale_factor ? entity . scale_factor : 1 )
126
126
* ( entity . value_factor ? 10 ** entity . value_factor : valueFactor ) ,
127
127
} ) ,
128
128
) ;
@@ -295,7 +295,7 @@ class MiniGraphCard extends LitElement {
295
295
style =${ entityConfig . state_adaptive_color ? `color: ${ this . computeColor ( state , id ) } ;` : '' } >
296
296
${ entityConfig . show_indicator ? this . renderIndicator ( state , id ) : '' }
297
297
< span class ="state__value ellipsis ">
298
- ${ this . computeState ( isPrimary && tooltipValue || state , entityConfig . value_multipler ) }
298
+ ${ this . computeState ( isPrimary && tooltipValue || state , entityConfig . scale_factor ) }
299
299
</ span >
300
300
< span class ="state__uom ellipsis ">
301
301
${ this . computeUom ( isPrimary && entity || id ) }
@@ -580,7 +580,7 @@ class MiniGraphCard extends LitElement {
580
580
< div class ="info__item ">
581
581
< span class ="info__item__type "> ${ entry . type } </ span >
582
582
< span class ="info__item__value ">
583
- ${ this . computeState ( entry . state , entry . value_multipler ) } ${ this . computeUom ( 0 ) }
583
+ ${ this . computeState ( entry . state , entry . scale_factor ) } ${ this . computeUom ( 0 ) }
584
584
</ span >
585
585
< span class ="info__item__time ">
586
586
${ entry . type !== 'avg' ? getTime ( new Date ( entry . last_changed ) , this . config . format , this . _hass . language ) : '' }
@@ -682,7 +682,7 @@ class MiniGraphCard extends LitElement {
682
682
) ;
683
683
}
684
684
685
- computeState ( inState , default_multiplier ) {
685
+ computeState ( inState , default_scale_factor ) {
686
686
if ( this . config . state_map . length > 0 ) {
687
687
const stateMap = Number . isInteger ( inState )
688
688
? this . config . state_map [ inState ]
@@ -703,16 +703,16 @@ class MiniGraphCard extends LitElement {
703
703
}
704
704
const dec = this . config . decimals ;
705
705
const value_factor = 10 ** this . config . value_factor ;
706
- const value_multipler = this . config . value_multipler || default_multiplier || 1 ;
706
+ const scale_factor = default_scale_factor || this . config . scale_factor || 1 ;
707
707
708
708
if ( dec === undefined || Number . isNaN ( dec ) || Number . isNaN ( state ) ) {
709
- return this . numberFormat ( ( Math . round ( state * value_factor * value_multipler * 100 ) / 100 ) ,
709
+ return this . numberFormat ( ( Math . round ( state * value_factor * scale_factor * 100 ) / 100 ) ,
710
710
this . _hass . language ) ;
711
711
}
712
712
713
713
const x = 10 ** dec ;
714
714
return this . numberFormat (
715
- ( Math . round ( state * value_factor * x * value_multipler ) / x ) . toFixed ( dec ) ,
715
+ ( Math . round ( state * value_factor * x * scale_factor ) / x ) . toFixed ( dec ) ,
716
716
this . _hass . language , dec ,
717
717
) ;
718
718
}
@@ -945,7 +945,7 @@ class MiniGraphCard extends LitElement {
945
945
if ( stateHistory . length === 0 ) return ;
946
946
947
947
if ( this . entity [ 0 ] && entity . entity_id === this . entity [ 0 ] . entity_id ) {
948
- this . updateExtrema ( stateHistory , this . config . entities [ index ] . value_multipler || 1 ) ;
948
+ this . updateExtrema ( stateHistory , this . config . entities [ index ] . scale_factor || 1 ) ;
949
949
}
950
950
951
951
if ( this . config . entities [ index ] . fixed_value === true ) {
@@ -967,22 +967,22 @@ class MiniGraphCard extends LitElement {
967
967
return this . _hass . callApi ( 'GET' , url ) ;
968
968
}
969
969
970
- updateExtrema ( history , value_multipler ) {
970
+ updateExtrema ( history , scale_factor ) {
971
971
const { extrema, average } = this . config . show ;
972
972
this . abs = [
973
973
...( extrema ? [ {
974
974
type : 'min' ,
975
- value_multipler ,
975
+ scale_factor ,
976
976
...getMin ( history , 'state' ) ,
977
977
} ] : [ ] ) ,
978
978
...( average ? [ {
979
979
type : 'avg' ,
980
- value_multipler ,
980
+ scale_factor ,
981
981
state : getAvg ( history , 'state' ) ,
982
982
} ] : [ ] ) ,
983
983
...( extrema ? [ {
984
984
type : 'max' ,
985
- value_multipler ,
985
+ scale_factor ,
986
986
...getMax ( history , 'state' ) ,
987
987
} ] : [ ] ) ,
988
988
] ;
0 commit comments