${this.computeUom(isPrimary && entity || id)}
@@ -580,7 +580,7 @@ class MiniGraphCard extends LitElement {
${entry.type}
- ${this.computeState(entry.state, entry.value_multipler)} ${this.computeUom(0)}
+ ${this.computeState(entry.state, entry.scale_factor)} ${this.computeUom(0)}
${entry.type !== 'avg' ? getTime(new Date(entry.last_changed), this.config.format, this._hass.language) : ''}
@@ -682,7 +682,7 @@ class MiniGraphCard extends LitElement {
);
}
- computeState(inState, default_multiplier) {
+ computeState(inState, default_scale_factor) {
if (this.config.state_map.length > 0) {
const stateMap = Number.isInteger(inState)
? this.config.state_map[inState]
@@ -703,16 +703,16 @@ class MiniGraphCard extends LitElement {
}
const dec = this.config.decimals;
const value_factor = 10 ** this.config.value_factor;
- const value_multipler = this.config.value_multipler || default_multiplier || 1;
+ const scale_factor = default_scale_factor || this.config.scale_factor || 1;
if (dec === undefined || Number.isNaN(dec) || Number.isNaN(state)) {
- return this.numberFormat((Math.round(state * value_factor * value_multipler * 100) / 100),
+ return this.numberFormat((Math.round(state * value_factor * scale_factor * 100) / 100),
this._hass.language);
}
const x = 10 ** dec;
return this.numberFormat(
- (Math.round(state * value_factor * x * value_multipler) / x).toFixed(dec),
+ (Math.round(state * value_factor * x * scale_factor) / x).toFixed(dec),
this._hass.language, dec,
);
}
@@ -945,7 +945,7 @@ class MiniGraphCard extends LitElement {
if (stateHistory.length === 0) return;
if (this.entity[0] && entity.entity_id === this.entity[0].entity_id) {
- this.updateExtrema(stateHistory, this.config.entities[index].value_multipler || 1);
+ this.updateExtrema(stateHistory, this.config.entities[index].scale_factor || 1);
}
if (this.config.entities[index].fixed_value === true) {
@@ -967,22 +967,22 @@ class MiniGraphCard extends LitElement {
return this._hass.callApi('GET', url);
}
- updateExtrema(history, value_multipler) {
+ updateExtrema(history, scale_factor) {
const { extrema, average } = this.config.show;
this.abs = [
...(extrema ? [{
type: 'min',
- value_multipler,
+ scale_factor,
...getMin(history, 'state'),
}] : []),
...(average ? [{
type: 'avg',
- value_multipler,
+ scale_factor,
state: getAvg(history, 'state'),
}] : []),
...(extrema ? [{
type: 'max',
- value_multipler,
+ scale_factor,
...getMax(history, 'state'),
}] : []),
];