Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ See [Speaker group management](#speaker-group-management) for example usage.
- linkplay<sup>[2](#speaker_foot2)</sup>
- media_player<sup>[3](#speaker_foot3)</sup>
- heos
- owntone<sup>[1](#speaker_foot1)</sup>

| Name | Type | Default | Description |
|------|------|---------|-------------|
Expand Down
3 changes: 2 additions & 1 deletion src/components/groupList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import './button';
import { HomeAssistant } from '../types';
import MediaPlayerObject from '../model';
import { MiniMediaPlayerSpeakerGroupEntry } from '../config/types';
import { PLATFORM} from './../const';
import { GroupChangeEvent } from './groupItem';

@customElement('mmp-group-list')
Expand Down Expand Up @@ -80,7 +81,7 @@ class MiniMediaPlayerGroupList extends LitElement {
@change=${this.handleGroupChange}
.item=${item}
.hass=${this.hass}
.checked=${itemId === entityId || this.group.includes(itemId)}
.checked=${(this.player.config.speaker_group.platform === PLATFORM.OWNTONE && this.hass.states[itemId].state !== "off") || itemId === entityId || this.group.includes(itemId)}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should try to not have platform specific logic spread throughout components, let's handle that in the Media Player model class.
Also how does the owntone checked logic work?
Should all owntone entities that are not "off" be considered as grouped? that doesn't seem right to me?

.disabled=${itemId === entityId || !this.isMaster}
.master=${itemId === this.master}
/>`;
Expand Down
1 change: 1 addition & 0 deletions src/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ const PLATFORM = {
SOUNDTOUCH: 'soundtouch',
MEDIAPLAYER: 'media_player',
HEOS: 'heos',
OWNTONE: 'owntone'
};

const CONTRAST_RATIO = 4.5;
Expand Down
16 changes: 16 additions & 0 deletions src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,14 @@ export default class MediaPlayerObject {
},
PLATFORM.MEDIAPLAYER,
);
case PLATFORM.OWNTONE:
return this.callService(
e,
'turn_on',
{
entity_id: entity
}
);
default:
return this.callService(e, 'join', options, platform);
}
Expand Down Expand Up @@ -453,6 +461,14 @@ export default class MediaPlayerObject {
},
PLATFORM.MEDIAPLAYER,
);
case PLATFORM.OWNTONE:
return this.callService(
e,
'turn_off',
{
entity_id: entity
}
);
default:
return this.callService(e, 'unjoin', options, platform);
}
Expand Down