Skip to content

Commit

Permalink
feature: make it possible to change source
Browse files Browse the repository at this point in the history
fixes #193
  • Loading branch information
punxaphil committed Dec 4, 2023
1 parent 9f1d367 commit e2aeca8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/sections/volumes.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { css, html, LitElement } from 'lit';
import { property, state } from 'lit/decorators.js';
import Store from '../model/store';
import { CardConfig } from '../types';
import { CardConfig, MediaPlayerEntityFeature } from '../types';
import { until } from 'lit-html/directives/until.js';
import { when } from 'lit/directives/when.js';
import { iconButton } from '../components/icon-button';
Expand All @@ -10,6 +10,7 @@ import MediaControlService from '../services/media-control-service';
import { MediaPlayer } from '../model/media-player';
import HassService from '../services/hass-service';
import { HassEntity } from 'home-assistant-js-websocket';
import { haPlayer } from '../components/ha-player';

class Volumes extends LitElement {
@property() store!: Store;
Expand Down Expand Up @@ -61,7 +62,13 @@ class Volumes extends LitElement {
)}
</div>
<div class="switches">
${when(!updateMembers && this.showSwitches[player.id], () => until(this.getAdditionalControls(player)))}
${when(
!updateMembers && this.showSwitches[player.id],
() => html`
${haPlayer(this.store, [MediaPlayerEntityFeature.SELECT_SOURCE])}
${until(this.getAdditionalControls(player))}
`,
)}
</div>
</div>`;
}
Expand Down

0 comments on commit e2aeca8

Please sign in to comment.