diff --git a/README.md b/README.md index e87481b0..0e77a342 100644 --- a/README.md +++ b/README.md @@ -666,6 +666,7 @@ Parameters for the `custom:frigate-card-menu-submenu` element are identical to t | `entity` | | An optional Home Assistant entity from which title, icon and style can be automatically computed. | | `state_color` | `true` | Whether or not the title and icon should be stylized based on state. | | `selected` | `false` | Whether or not to show this item as selected. | +| `enabled` | `true` | Whether or not to show this item as enabled / selectable. | | `style` | | Position and style the element using CSS. | | `tap_action`, `double_tap_action`, `hold_action`, `start_tap`, `end_tap` | | [Home Assistant action configuration](https://www.home-assistant.io/lovelace/actions) including the extended functionality described under [actions](#actions). | diff --git a/src/components/submenu.ts b/src/components/submenu.ts index 38be9689..df601177 100644 --- a/src/components/submenu.ts +++ b/src/components/submenu.ts @@ -49,7 +49,7 @@ export class FrigateCardSubmenu extends LitElement { ?twoline=${!!item.subtitle} ?selected=${item.selected} ?activated=${item.selected} - ?disabled=${!!item.disabled} + ?disabled=${item.enabled === false} aria-label="${stateParameters.title || ''}" @action=${(ev) => { // Attach the action config so ascendants have access to it. diff --git a/src/types.ts b/src/types.ts index a78cdcd5..f754ab13 100644 --- a/src/types.ts +++ b/src/types.ts @@ -432,7 +432,7 @@ const menuSubmenuItemSchema = elementsBaseSchema.extend({ state_color: z.boolean().default(true).optional(), selected: z.boolean().default(false).optional(), subtitle: z.string().optional(), - disabled: z.boolean().optional(), + enabled: z.boolean().default(true).optional(), }); export type MenuSubmenuItem = z.infer;