Merge pull request #684 from dermotduffy/state-color
Fix state color in submenu items
This commit is contained in:
@@ -366,6 +366,7 @@ export class FrigateCard extends LitElement {
|
|||||||
camera: camera,
|
camera: camera,
|
||||||
});
|
});
|
||||||
return {
|
return {
|
||||||
|
enabled: true,
|
||||||
icon: getCameraIcon(this._hass, config),
|
icon: getCameraIcon(this._hass, config),
|
||||||
entity: config.camera_entity,
|
entity: config.camera_entity,
|
||||||
state_color: true,
|
state_color: true,
|
||||||
@@ -538,6 +539,8 @@ export class FrigateCard extends LitElement {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
enabled: true,
|
||||||
|
selected: false,
|
||||||
icon: getEntityIcon(this._hass, playerEntityID) || 'mdi:cast',
|
icon: getEntityIcon(this._hass, playerEntityID) || 'mdi:cast',
|
||||||
entity: playerEntityID,
|
entity: playerEntityID,
|
||||||
state_color: false,
|
state_color: false,
|
||||||
|
|||||||
@@ -138,8 +138,7 @@ export class FrigateCardSubmenuSelect extends LitElement {
|
|||||||
return (
|
return (
|
||||||
changedProps.size != 1 ||
|
changedProps.size != 1 ||
|
||||||
!this.submenuSelect ||
|
!this.submenuSelect ||
|
||||||
(!!oldHass &&
|
(!!oldHass && isHassDifferent(this.hass, oldHass, [this.submenuSelect.entity]))
|
||||||
isHassDifferent(this.hass, oldHass, [this.submenuSelect.entity]))
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -187,7 +186,9 @@ export class FrigateCardSubmenuSelect extends LitElement {
|
|||||||
)
|
)
|
||||||
: option;
|
: option;
|
||||||
submenu.items.push({
|
submenu.items.push({
|
||||||
|
state_color: true,
|
||||||
selected: stateObj.state === option,
|
selected: stateObj.state === option,
|
||||||
|
enabled: true,
|
||||||
title: title || option,
|
title: title || option,
|
||||||
...((entity.startsWith('select.') || entity.startsWith('input_select.')) && {
|
...((entity.startsWith('select.') || entity.startsWith('input_select.')) && {
|
||||||
tap_action: {
|
tap_action: {
|
||||||
|
|||||||
+3
-3
@@ -466,10 +466,10 @@ export type MenuStateIcon = z.infer<typeof menuStateIconSchema>;
|
|||||||
const menuSubmenuItemSchema = elementsBaseSchema.extend({
|
const menuSubmenuItemSchema = elementsBaseSchema.extend({
|
||||||
entity: z.string().optional(),
|
entity: z.string().optional(),
|
||||||
icon: z.string().optional(),
|
icon: z.string().optional(),
|
||||||
state_color: z.boolean().default(true).optional(),
|
state_color: z.boolean().default(true),
|
||||||
selected: z.boolean().default(false).optional(),
|
selected: z.boolean().default(false),
|
||||||
subtitle: z.string().optional(),
|
subtitle: z.string().optional(),
|
||||||
enabled: z.boolean().default(true).optional(),
|
enabled: z.boolean().default(true),
|
||||||
});
|
});
|
||||||
export type MenuSubmenuItem = z.infer<typeof menuSubmenuItemSchema>;
|
export type MenuSubmenuItem = z.infer<typeof menuSubmenuItemSchema>;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user