Skip to content

Commit

Permalink
Add grid support to lock card
Browse files Browse the repository at this point in the history
  • Loading branch information
piitaya committed Mar 5, 2024
1 parent 41d84ba commit e09dbd5
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions src/cards/lock-card/lock-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ registerCustomCard({
});

@customElement(LOCK_CARD_NAME)
export class LockCard extends MushroomBaseCard implements LovelaceCard {
export class LockCard extends MushroomBaseCard<LockCardConfig, LockEntity> implements LovelaceCard {
public static async getConfigElement(): Promise<LovelaceCardEditor> {
await import("./lock-card-editor");
return document.createElement(LOCK_CARD_EDITOR_NAME) as LovelaceCardEditor;
Expand All @@ -52,22 +52,8 @@ export class LockCard extends MushroomBaseCard implements LovelaceCard {
};
}

@state() private _config?: LockCardConfig;

getCardSize(): number | Promise<number> {
return 1;
}

setConfig(config: LockCardConfig): void {
this._config = {
tap_action: {
action: "more-info",
},
hold_action: {
action: "more-info",
},
...config,
};
protected get hasControls(): boolean {
return true;
}

private _handleAction(ev: ActionHandlerEvent) {
Expand Down

0 comments on commit e09dbd5

Please sign in to comment.