Fix lock icon by adding lock domain

Fixes #41
This commit is contained in:
Aalian Khan
2023-09-05 18:57:19 -04:00
parent 59f74303ea
commit 1025201e2b
4 changed files with 46 additions and 1 deletions

File diff suppressed because one or more lines are too long

39
src/cards/LockCard.js Normal file
View File

@@ -0,0 +1,39 @@
import {AbstractCard} from "./AbstractCard";
/**
* Lock Card Class
*
* Used to create a card for controlling an entity of the lock domain.
*
* @class
* @extends AbstractCard
*/
class LockCard extends AbstractCard {
/**
* Default options of the card.
*
* @type {lockCardOptions}
* @private
*/
#defaultOptions = {
type: "custom:mushroom-lock-card",
icon: undefined,
};
/**
* Class constructor.
*
* @param {hassEntity} entity The hass entity to create a card for.
* @param {lockCardOptions} [options={}] Options for the card.
* @throws {Error} If the Helper module isn't initialized.
*/
constructor(entity, options = {}) {
super(entity);
this.mergeOptions(
this.#defaultOptions,
options,
);
}
}
export {LockCard};

View File

@@ -17,6 +17,7 @@ class MediaPlayerCard extends AbstractCard {
*/
#defaultOptions = {
type: "custom:mushroom-media-player-card",
icon: undefined,
use_media_info: true,
media_controls: [
"on_off",

View File

@@ -86,6 +86,11 @@ export const optionDefaults = {
showControls: false,
hidden: false,
},
lock: {
title: "Locks",
showControls: false,
hidden: false,
},
climate: {
title: "Climates",
showControls: false,