Skip to content

Commit

Permalink
fix: improve the info text when no players found
Browse files Browse the repository at this point in the history
  • Loading branch information
punxaphil committed Dec 22, 2024
1 parent 2c46e92 commit 6412041
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion src/card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ export class Card extends LitElement {
const contentHeight = showFooter ? height - footerHeight : height;
const title = this.config.title;
height = title ? height + TITLE_HEIGHT : height;
const noPlayersText = isSonosCard(this.config)
? 'No supported players found'
: "No players found. Make sure you have configured entities in the card's configuration, or configured `entityPlatform`.";
return html`
<ha-card style=${this.haCardStyle(height)}>
<div class="loader" ?hidden=${!this.showLoader}>
Expand Down Expand Up @@ -78,7 +81,7 @@ export class Card extends LitElement {
html`<sonos-queue .store=${this.store} @item-selected=${this.onMediaItemSelected}></sonos-queue>`,
],
])
: html`<div class="no-players">No supported players found</div>`
: html`<div class="no-players">${noPlayersText}</div>`
}
</div>
${when(
Expand Down
5 changes: 0 additions & 5 deletions src/editor/advanced-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ import { html, TemplateResult } from 'lit';
import { BaseEditor } from './base-editor';

export const ADVANCED_SCHEMA = [
{
name: 'entityPlatform',
help: 'Show all media players for the selected platform',
type: 'string',
},
{
name: 'hideGroupCurrentTrack',
selector: { boolean: {} },
Expand Down
5 changes: 5 additions & 0 deletions src/editor/entities-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ export const ENTITIES_SCHEMA = [
cardType: 'sonos',
selector: { boolean: {} },
},
{
name: 'entityPlatform',
help: 'Show all media players for the selected platform',
type: 'string',
},
];

class EntitiesEditor extends BaseEditor {
Expand Down

0 comments on commit 6412041

Please sign in to comment.