Skip to content

Commit 352ca63

Browse files
authored
Merge pull request #382 from droans/dev
v2.4.0
2 parents ae35ab3 + cc7c32e commit 352ca63

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+1887
-1490
lines changed

.github/release-drafter-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ exclude-labels:
5757
- "no-changelog"
5858

5959
template: |
60-
# Music Assistant Queue Actions v$RESOLVED_VERSION
60+
# Music Assistant Player Card v$RESOLVED_VERSION
6161
6262
$CHANGES

.github/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ exclude-labels:
5555
- "no-changelog"
5656

5757
template: |
58-
# Music Assistant Queue Actions v$RESOLVED_VERSION
58+
# Music Assistant Player Card v$RESOLVED_VERSION
5959
6060
$CHANGES

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -530,15 +530,16 @@ Display and interact with the player's queue.
530530
## Queue Hidden Elements Config
531531
Multiple elements on the queue tab can be hidden. By default, all elements are visible
532532

533-
| Parameter | Type | Required | Default | Description |
534-
|------------------|-------|----------|-------------|----------------------------|
535-
| action_buttons | bool | No | false | Hides the action buttons |
536-
| move_down_button | bool | No | false | Hides the Move Down button |
537-
| move_up_button | bool | No | false | Hides the Move Up button |
538-
| move_next_button | bool | No | false | Hides the Move Next button |
539-
| remove_button | bool | No | false | Hides the Remove button |
540-
| album_covers | bool | No | false | Hides album covers |
541-
| artist_names | bool | No | false | Hides artist names |
533+
| Parameter | Type | Required | Default | Description |
534+
|--------------------|-------|----------|-------------|------------------------------|
535+
| action_buttons | bool | No | false | Hides the action buttons |
536+
| move_down_button | bool | No | false | Hides the Move Down button |
537+
| move_up_button | bool | No | false | Hides the Move Up button |
538+
| move_next_button | bool | No | false | Hides the Move Next button |
539+
| remove_button | bool | No | false | Hides the Remove button |
540+
| album_covers | bool | No | false | Hides album covers |
541+
| artist_names | bool | No | false | Hides artist names |
542+
| clear_queue_button | bool | No | false | Hides the Clear Queue button |
542543

543544
## Media Browser Config
544545

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"description": "Custom Music Assistant Player Card for Home Assistant",
44
"repository": "https://github.com/droans/mass-player-card",
55
"author": "Michael Carroll",
6-
"version": "2.3.1",
6+
7+
"version": "2.4.0",
78
"module": "mass-player-card.js",
89
"keywords": [
910
"home-assistant",
@@ -22,6 +23,7 @@
2223
"license": "MIT",
2324
"type": "module",
2425
"dependencies": {
26+
"@droans/webawesome": "^3.0.0",
2527
"@lit/context": "1.1.6",
2628
"@material/material-color-utilities": "^0.3.0",
2729
"@material/web": "2.4.1",
@@ -32,27 +34,26 @@
3234
"lit": "3.3.1"
3335
},
3436
"devDependencies": {
35-
"@awesome.me/webawesome": "^3.0.0",
3637
"@eslint/js": "9.39.1",
3738
"@lit-labs/compiler": "^1.1.1",
3839
"@rollup/plugin-json": "^6.0.0",
3940
"@rollup/plugin-node-resolve": "^16.0.3",
4041
"@rollup/plugin-terser": "^0.4.0",
4142
"@rollup/plugin-typescript": "^12.3.0",
42-
"@typescript-eslint/eslint-plugin": "^8.48.0",
43-
"@typescript-eslint/parser": "^8.48.0",
43+
"@typescript-eslint/eslint-plugin": "^8.49.0",
44+
"@typescript-eslint/parser": "^8.49.0",
4445
"eslint": "9.39.1",
4546
"eslint-config-prettier": "10.1.8",
4647
"eslint-plugin-jest": "29.2.1",
4748
"eslint-plugin-lit": "^2.1.1",
4849
"eslint-plugin-wc": "^3.0.2",
4950
"mass-queue-types": "^0.8.1",
50-
"prettier": "^3.6.2",
51+
"prettier": "^3.7.4",
5152
"rollup": "^4.53.3",
5253
"rollup-plugin-commonjs": "^10.1.0",
5354
"rollup-plugin-serve": "^3.0.0",
5455
"typescript": "5.9.3",
55-
"typescript-eslint": "8.48.0"
56+
"typescript-eslint": "8.49.0"
5657
},
5758
"scripts": {
5859
"start": "rollup -c rollup.config.dev.js --watch",

src/actions/browser-actions.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
import { EnqueueOptions } from "../const/actions";
2-
import { ExtendedHass, MediaTypes } from "../const/common";
1+
import { EnqueueOptions } from "../const/enums";
2+
import { MediaTypes } from "../const/enums";
33
import {
44
DEFAULT_SEARCH_LIMIT,
5-
MediaLibraryItem,
6-
RecommendationResponse,
75
} from "../const/media-browser";
86
import { getRecommendationsServiceSchema } from "mass-queue-types/packages/mass_queue/actions/get_recommendations";
97
import { getLibraryServiceResponse, getLibraryServiceSchema } from "mass-queue-types/packages/music_assistant/actions/get_library"
108
import { searchServiceResponse, searchServiceSchema } from "mass-queue-types/packages/music_assistant/actions/search"
9+
import { ExtendedHass, MediaLibraryItem, RecommendationResponse } from "../const/types";
1110
export default class BrowserActions {
1211
private _hass!: ExtendedHass;
1312

@@ -79,15 +78,16 @@ export default class BrowserActions {
7978
player_entity_id: string,
8079
media_type: MediaTypes,
8180
limit = 25,
82-
favorite = true,
81+
favorite: boolean | null = true,
8382
): Promise<MediaLibraryItem[]> {
8483
const config_id = await this.getPlayerConfigEntry(player_entity_id);
84+
const favorite_data = typeof(favorite) == 'boolean' ? {favorite: favorite} : {}
8585
const data: getLibraryServiceSchema = {
8686
type: "call_service",
8787
domain: "music_assistant",
8888
service: "get_library",
8989
service_data: {
90-
favorite: favorite,
90+
...favorite_data,
9191
limit: limit,
9292
config_entry_id: config_id,
9393
media_type: media_type,

src/actions/player-actions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable no-console */
22
import { HassEntity } from "home-assistant-js-websocket";
3-
import { ExtendedHass, ExtendedHassEntity, RepeatMode } from "../const/common";
4-
import { QueueItem } from "../const/player-queue";
3+
import { RepeatMode } from "../const/enums";
4+
import { ExtendedHass, ExtendedHassEntity, QueueItem } from "../const/types";
55
import { getQueueItemsServiceResponse, getQueueItemsServiceSchema } from "mass-queue-types/packages/mass_queue/actions/get_queue_items";
66
import { getInfoWSResponseSchema, getInfoWSServiceSchema } from "mass-queue-types/packages/mass_queue/ws/get_info"
77

src/actions/players-actions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable no-console */
2-
import { ExtendedHass } from "../const/common";
2+
import { ExtendedHass } from "../const/types";
33

44
export default class PlayersActions {
55
private _hass!: ExtendedHass;

src/actions/queue-actions.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/* eslint-disable no-console */
2-
import { QueueItems } from "../const/player-queue";
3-
import { ExtendedHass } from "../const/common";
2+
import { ExtendedHass, QueueItems } from "../const/types";
43
import {
54
getQueueItemsServiceResponse,
65
getQueueItemsServiceSchema,

src/components/button.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { CSSResultGroup, html, LitElement, TemplateResult } from "lit";
22
import styles from '../styles/button'
33
import { property } from "lit/decorators.js";
4-
import { ButtonColorRole } from "../const/common.js";
4+
import { ButtonColorRole } from "../const/enums";
55
import { consume } from "@lit/context";
6-
import { configContext } from "../const/context.js";
7-
import { Config } from "../config/config.js";
6+
import { configContext } from "../const/context";
7+
import { Config } from "../config/config";
88

99
const DEFAULT_COLOR_ROLE = ButtonColorRole.Filled;
1010
const DEFAULT_BUTTON_SIZE = "small"

src/components/media-browser-cards.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,23 @@ import "./media-card";
1313
import {
1414
CardEnqueueService,
1515
CardSelectedService,
16-
EnqueueOptions,
1716
} from "../const/actions";
18-
import { ExtendedHass } from "../const/common";
1917
import {
2018
activeMediaBrowserCardsContext,
21-
hassExt,
19+
hassContext,
2220
mediaBrowserConfigContext,
2321
} from "../const/context";
24-
import { MediaCardData, MediaCardItem } from "../const/media-browser";
22+
import { ExtendedHass, MediaCardData, MediaCardItem } from "../const/types";
2523

2624
import styles from "../styles/media-browser-cards";
27-
import { MediaBrowserConfig } from "../config/media-browser.js";
28-
import { jsonMatch } from "../utils/util.js";
25+
import { MediaBrowserConfig } from "../config/media-browser";
26+
import { jsonMatch } from "../utils/util";
27+
import { EnqueueOptions } from "../const/enums";
2928

3029
export class MediaBrowserCards extends LitElement {
3130
@state() public code!: TemplateResult;
3231

33-
@consume({ context: hassExt, subscribe: true })
32+
@consume({ context: hassContext, subscribe: true })
3433
public hass!: ExtendedHass;
3534

3635
@query(".icons") private _iconsElement?: HTMLDivElement;

0 commit comments

Comments
 (0)