Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

Commit

Permalink
On the other hand, let's not make it a lit-element.
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasloven committed Oct 31, 2018
1 parent 1c480ba commit fc1adb2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
# NOTE! THIS CARD MUST BE IMPORTED AS A MODULE!

```yaml
resources:
- url: /local/card-modder.js
type: module
```
```yaml
- type: custom:card-modder
card:
Expand Down
13 changes: 4 additions & 9 deletions card-modder.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
import {html, LitElement} from "https://unpkg.com/@polymer/lit-element?module";
class CardModder extends LitElement {

static get properties() {
return {
hass: Object,
config: Object,
};
}
class CardModder extends HTMLElement {

render()
{
Expand All @@ -28,6 +20,8 @@ class CardModder extends LitElement {
await this.card.updateComplete;
}
this._cardMod();

this.appendChild(this.card);
}

async _cardMod() {
Expand Down Expand Up @@ -59,6 +53,7 @@ class CardModder extends LitElement {
}

set hass(hass) {
if(!hass) return;
if(this.card) this.card.hass = hass;
}

Expand Down

0 comments on commit fc1adb2

Please sign in to comment.