From f8eb88a82ed1a95bf7dc693f71cd4c7d515d74d4 Mon Sep 17 00:00:00 2001 From: Johan Frick Date: Thu, 4 Jan 2024 20:45:03 +0100 Subject: [PATCH] fix: excludeItemsInEntitiesList should default to false --- src/components/player-controls.ts | 2 +- src/model/store.ts | 2 +- src/sections/volumes.ts | 2 +- src/types.ts | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/player-controls.ts b/src/components/player-controls.ts index b4df513a..93696b56 100755 --- a/src/components/player-controls.ts +++ b/src/components/player-controls.ts @@ -21,7 +21,7 @@ class PlayerControls extends LitElement { this.activePlayer = this.store.activePlayer; this.mediaControlService = this.store.mediaControlService; - const noUpDown = this.config.showVolumeUpAndDownButtons && nothing; + const noUpDown = !!this.config.showVolumeUpAndDownButtons && nothing; return html`
${when( diff --git a/src/model/store.ts b/src/model/store.ts index 6f943a1f..b9a0c54b 100644 --- a/src/model/store.ts +++ b/src/model/store.ts @@ -114,7 +114,7 @@ export default class Store { .filter(getGroupPlayerIds) .filter((hassEntity) => { const includesEntity = configEntities.includes(hassEntity.entity_id); - return !configEntities.length || this.config.excludeItemsInEntitiesList !== includesEntity; + return !configEntities.length || !!this.config.excludeItemsInEntitiesList !== includesEntity; }) .sort((a, b) => a.entity_id.localeCompare(b.entity_id)); } diff --git a/src/sections/volumes.ts b/src/sections/volumes.ts index e4ebf52a..bd296aa7 100755 --- a/src/sections/volumes.ts +++ b/src/sections/volumes.ts @@ -41,7 +41,7 @@ class Volumes extends LitElement { : player.name; const volDown = async () => await this.mediaControlService.volumeDown(player, updateMembers); const volUp = async () => await this.mediaControlService.volumeUp(player, updateMembers); - const noUpDown = this.config.showVolumeUpAndDownButtons && nothing; + const noUpDown = !!this.config.showVolumeUpAndDownButtons && nothing; const hideSwitches = updateMembers || !this.showSwitches[player.id]; return html`
diff --git a/src/types.ts b/src/types.ts index 39030c88..cca7c16d 100644 --- a/src/types.ts +++ b/src/types.ts @@ -20,9 +20,9 @@ export type ConfigPredefinedGroupPlayer = PredefinedGroupPlayer; export type ConfigPredefinedGroup = PredefinedGroup; export interface CardConfig extends LovelaceCardConfig { sections?: Section[]; - showVolumeUpAndDownButtons: boolean; + showVolumeUpAndDownButtons?: boolean; entities?: string[]; - excludeItemsInEntitiesList: boolean; + excludeItemsInEntitiesList?: boolean; predefinedGroups?: ConfigPredefinedGroup[]; title?: string; labelWhenNoMediaIsSelected?: string; @@ -32,14 +32,14 @@ export interface CardConfig extends LovelaceCardConfig { artworkHostname?: string; widthPercentage?: number; heightPercentage?: number; - hideGroupCurrentTrack: boolean; - dynamicVolumeSlider: boolean; + hideGroupCurrentTrack?: boolean; + dynamicVolumeSlider?: boolean; mediaArtworkOverrides?: MediaArtworkOverride[]; customSources?: CustomSources; customThumbnail?: CustomThumbnails; customThumbnailIfMissing?: CustomThumbnails; mediaBrowserTitlesToIgnore?: string[]; - mediaBrowserItemsPerRow: number; + mediaBrowserItemsPerRow?: number; mediaBrowserShowTitleForThumbnailIcons?: boolean; topFavorites?: string[]; numberOfFavoritesToShow?: number;