Edit Lovelace card docs for new resource config (#446)

* Edit Lovelace card docs for new resource config

* Update lovelace_custom_card.md
This commit is contained in:
Bram Kragten 2020-03-21 20:19:44 +01:00 committed by GitHub
parent b1ad6ba137
commit 3a6b50c4ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,11 +86,11 @@ customElements.define('content-card-example', ContentCardExample);
In our example card we defined a card with the tag `content-card-example` (see last line), so our card type will be `custom:content-card-example`. And because you created the file in your `<config>/www` directory, it will be accessible in your browser via the url `/local/` (if you have recently added the www folder you will need to re-start Home Assistant for files to be picked up).
Add a resource to your Lovelace config with URL `/local/content-card-example.js` and type `module`.
You can then use your card in your Lovelace configuration:
```yaml
# Example Lovelace configuration
resources:
- url: /local/content-card-example.js
type: module
views:
- name: Example
cards:
@ -207,13 +207,12 @@ class WiredToggleCard extends LitElement {
customElements.define("wired-toggle-card", WiredToggleCard);
```
Add a resource to your Lovelace config with URL `/local/wired-cards.js` and type `module`.
And for your configuration:
```yaml
# Example Lovelace configuration
resources:
- url: /local/wired-cards.js
type: module
views:
- name: Example
cards: