diff --git a/CHANGELOG.md b/CHANGELOG.md index 8be2cad..6f89420 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ Changelog ==== +## 0.0.16 +### Fixes +* Prepare for future card config changes. + ## 0.0.15 ### Improvements * Removal of support for Customer Updater. diff --git a/package.json b/package.json index 7c7050a..ed02de2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "power-wheel-card", - "version": "0.0.15", + "version": "0.0.16", "description": "An intuitive way to represent the power and energy that your home is consuming or producing.", "directories": { "test": "test" diff --git a/power-wheel-card.js b/power-wheel-card.js index 642cfd8..9698310 100644 --- a/power-wheel-card.js +++ b/power-wheel-card.js @@ -5,7 +5,7 @@ * */ -const __VERSION = "0.0.15"; +const __VERSION = "0.0.16"; const LitElement = Object.getPrototypeOf(customElements.get("hui-view")); const html = LitElement.prototype.html; @@ -540,6 +540,7 @@ class PowerWheelCard extends LitElement { } setConfig(config) { + config = Object.assign({}, config); if (!config.solar_power_entity) { throw new Error('You need to define a solar_power_entity'); } @@ -618,6 +619,7 @@ class PowerWheelCard extends LitElement { this.autoToggleView = config.initial_auto_toggle_view; this.sensors = this._getSensors(config); this.view = config.initial_view; + // todo: remove this second assign this.config = Object.assign({}, config); }