Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/panels/lovelace/cards/hui-button-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ export class HuiButtonCard extends LitElement implements LovelaceCard {
}

public setConfig(config: ButtonCardConfig): void {
if (!config.entity) {
throw new Error("Entity must be specified");
}
if (config.entity && !isValidEntityId(config.entity)) {
throw new Error("Invalid entity");
}
Expand Down
9 changes: 8 additions & 1 deletion src/panels/lovelace/cards/hui-entity-button-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@ import { customElement } from "lit-element";
import { HuiButtonCard } from "./hui-button-card";

@customElement("hui-entity-button-card")
class HuiEntityButtonCard extends HuiButtonCard {}
class HuiEntityButtonCard extends HuiButtonCard {
public setConfig(config): void {
if (!config.entity) {
throw new Error("Entity must be specified");
}
super.setConfig(config);
}
}

declare global {
interface HTMLElementTagNameMap {
Expand Down