Skip to content

Commit

Permalink
Move values to const.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jozefKruszynski committed Nov 18, 2024
1 parent 38e8f07 commit 45fc0c4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
5 changes: 5 additions & 0 deletions custom_components/mass/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,15 @@
ATTR_GROUP_LEADER = "group_leader"
ATTR_MASS_PLAYER_ID = "mass_player_id"
ATTR_MASS_PLAYER_TYPE = "mass_player_type"
ATTR_MEDIA_ID = "media_id"
ATTR_MEDIA_TYPE = "media_type"
ATTR_RADIO_MODE = "radio_mode"
ATTR_STREAM_TITLE = "stream_title"

CONF_OPENAI_AGENT_ID = "openai_agent_id"
CONF_ASSIST_AUTO_EXPOSE_PLAYERS = "expose_players_assist"
CONF_PRE_ANNOUNCE_TTS = "pre_announce_tts"

SERVICE_PLAY_MEDIA_ADVANCED = "play_media"

LOGGER = logging.getLogger(__package__)
4 changes: 2 additions & 2 deletions custom_components/mass/intent.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
from music_assistant_models.media_items import MediaItemType

from . import DOMAIN
from .const import CONF_OPENAI_AGENT_ID
from .media_player import (
from .const import (
CONF_OPENAI_AGENT_ID,
ATTR_MEDIA_ID,
ATTR_MEDIA_TYPE,
ATTR_RADIO_MODE,
Expand Down
15 changes: 9 additions & 6 deletions custom_components/mass/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,15 @@
from music_assistant_models.event import MassEvent
from music_assistant_models.media_items import ItemMapping, MediaItemType, Track

from .const import ATTR_ACTIVE_QUEUE, ATTR_MASS_PLAYER_TYPE, DOMAIN
from .const import (
ATTR_ACTIVE_QUEUE,
ATTR_MASS_PLAYER_TYPE,
DOMAIN,
ATTR_RADIO_MODE,
ATTR_MEDIA_ID,
ATTR_MEDIA_TYPE,
SERVICE_PLAY_MEDIA_ADVANCED,
)
from .entity import MusicAssistantBaseEntity
from .media_browser import async_browse_media

Expand Down Expand Up @@ -87,14 +95,9 @@
MediaPlayerEnqueue.PLAY: QueueOption.PLAY,
MediaPlayerEnqueue.REPLACE: QueueOption.REPLACE,
}

SERVICE_PLAY_MEDIA_ADVANCED = "play_media"
SERVICE_PLAY_ANNOUNCEMEMT = "play_announcement"
SERVICE_TRANSFER_QUEUE = "transfer_queue"
SERVICE_GET_QUEUE = "get_queue"
ATTR_RADIO_MODE = "radio_mode"
ATTR_MEDIA_ID = "media_id"
ATTR_MEDIA_TYPE = "media_type"
ATTR_ARTIST = "artist"
ATTR_ALBUM = "album"
ATTR_URL = "url"
Expand Down

0 comments on commit 45fc0c4

Please sign in to comment.