From f39019ecdf8d20d2fdaa0021e1e51b344d4d44dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=ADn=20Gonz=C3=A1lez?= Date: Fri, 18 Sep 2020 15:40:45 +0200 Subject: [PATCH] Fix #23: Card doesn't work propertly in HA 0.115.x --- README.md | 2 +- dist/pvpc-hourly-pricing-card.js | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index bc21f7e..14254d5 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ You could use [HACS](https://hacs.xyz/) or follow this [guide](https://www.danie ```yaml resources: - url: /local/pvpc-hourly-pricing-card.js?v=0.0.1 + url: /local/pvpc-hourly-pricing-card.js?v=1.2.3 type: module ``` diff --git a/dist/pvpc-hourly-pricing-card.js b/dist/pvpc-hourly-pricing-card.js index a802d3a..57a0c50 100644 --- a/dist/pvpc-hourly-pricing-card.js +++ b/dist/pvpc-hourly-pricing-card.js @@ -167,7 +167,10 @@ class PVPCHourlyPricingCard extends LitElement { updated(param) { this.setPVPCHourlyPricingObj(); let chart = this.shadowRoot.getElementById('Chart'); - if (chart) chart.data = this.ChartData; + if (chart) { + chart.data = this.ChartData; + chart.hass = this.hass; + } } render() { @@ -189,9 +192,7 @@ class PVPCHourlyPricingCard extends LitElement { } -
- Entity not available: ${this._config.entity} -
+
Entity not available: ${this._config.entity}
`; } @@ -300,9 +301,7 @@ class PVPCHourlyPricingCard extends LitElement { if (!this.despiction.minPriceNextDay) { return html` -
- ${this.ll('infoNoNextDay')} -
+
${this.ll('infoNoNextDay')}
`; } else { return html``; @@ -598,7 +597,7 @@ class PVPCHourlyPricingCard extends LitElement { case 'electric_car': const hours = new Date().getHours(); if (hours >= 1 && hours < 7) { - period = 'super-valley'; + period = 'super-valley'; } else if (hours >= 13 && hours < 23) { period = 'peak'; } else {