Merge pull request #548 from dermotduffy/enabled-disabled
For configuration consistency: Change menu subitem 'disabled' => 'enabled'
This commit is contained in:
@@ -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). |
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
+1
-1
@@ -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<typeof menuSubmenuItemSchema>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user