Skip to content

Commit 608c05c

Browse files
committed
Add power and volume control attributes to Player
1 parent 7e4c67c commit 608c05c

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
"""All (global/common) constants for Music Assistant."""
22

33
SECURE_STRING_SUBSTITUTE = "this_value_is_encrypted"
4+
5+
POWER_CONTROL_NATIVE = "native"
6+
POWER_CONTROL_NONE = "none"
7+
8+
VOLUME_CONTROL_NATIVE = "native"
9+
VOLUME_CONTROL_NONE = "none"

music_assistant_models/player.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
from mashumaro import DataClassDictMixin
1010

11+
from music_assistant_models.constants import POWER_CONTROL_NATIVE, VOLUME_CONTROL_NATIVE
12+
1113
from .enums import MediaType, PlayerFeature, PlayerState, PlayerType
1214
from .unique_list import UniqueList
1315

@@ -152,9 +154,15 @@ class Player(DataClassDictMixin):
152154
# and pass along freely
153155
extra_data: dict[str, Any] = field(default_factory=dict)
154156

155-
# announcement_in_progress boolean to indicate there's an announcement in progress.
157+
# announcement_in_progress: boolean to indicate there's an announcement in progress.
156158
announcement_in_progress: bool = False
157159

160+
# power_control: the power control attached to this player (set by config)
161+
power_control: str = POWER_CONTROL_NATIVE
162+
163+
# volume_control: the volume control attached to this player (set by config)
164+
volume_control: str = VOLUME_CONTROL_NATIVE
165+
158166
# last_poll: when was the player last polled (used with needs_poll)
159167
last_poll: float = 0
160168

0 commit comments

Comments
 (0)