This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Simplest possible custom card | |
// Does nothing. Doesn't look like anything | |
class MyCustomCard extends HTMLElement { | |
setConfig(config) { | |
// The config object contains the configuration specified by the user in ui-lovelace.yaml | |
// for your card. | |
// It will minimally contain: | |
// config.type = "custom:my-custom-card" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { LitElement, html } from "lit"; | |
import { customElement, property } from "lit/decorators.js"; | |
import { ScopedRegistryHost } from "@lit-labs/scoped-registry-mixin"; | |
@customElement("customelement-test") | |
class CustomElementTest extends ScopedRegistryHost(LitElement) { | |
@property() hass; | |
static elementDefinitions = { | |
"ha-card": customElements.get("ha-card"), // This works because ha-card is ALWAYS loaded before custom cards (for now) |