diff --git a/src/panels/lovelace/cards/hui-sensor-card.js b/src/panels/lovelace/cards/hui-sensor-card.js index 58890b3b50..58a8c96574 100755 --- a/src/panels/lovelace/cards/hui-sensor-card.js +++ b/src/panels/lovelace/cards/hui-sensor-card.js @@ -42,15 +42,11 @@ class HuiSensorCard extends EventsMixin(LitElement) { const cardConfig = { detail: 1, icon: false, - height: 100, hours_to_show: 24, - line_color: "var(--accent-color)", - line_width: 5, ...config, }; cardConfig.hours_to_show = Number(cardConfig.hours_to_show); cardConfig.height = Number(cardConfig.height); - cardConfig.line_width = Number(cardConfig.line_width); cardConfig.detail = cardConfig.detail === 1 || cardConfig.detail === 2 ? cardConfig.detail @@ -64,7 +60,7 @@ class HuiSensorCard extends EventsMixin(LitElement) { return change; } - render({ _config, _entity, _line } = this) { + render({ _entity, _line } = this) { return html` ${this._style()} @@ -85,11 +81,17 @@ class HuiSensorCard extends EventsMixin(LitElement) { ${ _line ? svg` - - - ` + + + + ` : "" } @@ -144,8 +146,8 @@ class HuiSensorCard extends EventsMixin(LitElement) { _calcPoints(history, hours, width, detail = 1) { const coords = []; - const margin = this._config.line_width; - const height = this._config.height - margin * 4; + const margin = 5; + const height = 80; width -= margin * 2; let yRatio = (this._max - this._min) / height; yRatio = yRatio !== 0 ? yRatio : height;