Skip to content

Commit

Permalink
Fix #23: Card doesn't work propertly in HA 0.115.x
Browse files Browse the repository at this point in the history
  • Loading branch information
danimart1991 committed Sep 18, 2020
1 parent 9848c79 commit f39019e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
15 changes: 7 additions & 8 deletions dist/pvpc-hourly-pricing-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -189,9 +192,7 @@ class PVPCHourlyPricingCard extends LitElement {
}
</style>
<ha-card>
<div class="not-found">
Entity not available: ${this._config.entity}
</div>
<div class="not-found">Entity not available: ${this._config.entity}</div>
</ha-card>
`;
}
Expand Down Expand Up @@ -300,9 +301,7 @@ class PVPCHourlyPricingCard extends LitElement {

if (!this.despiction.minPriceNextDay) {
return html`
<div class="info clear ${this.numberElements > 1 ? 'spacer' : ''}">
${this.ll('infoNoNextDay')}
</div>
<div class="info clear ${this.numberElements > 1 ? 'spacer' : ''}">${this.ll('infoNoNextDay')}</div>
`;
} else {
return html``;
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit f39019e

Please sign in to comment.