Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove intent based enqueue options #1888

Merged
merged 3 commits into from
Feb 10, 2024
Merged
Changes from 1 commit
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
8 changes: 2 additions & 6 deletions custom_components/mass/intent.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Intents for the client integration."""

from __future__ import annotations

import json
Expand All @@ -8,7 +9,6 @@
from homeassistant.components.conversation import ATTR_AGENT_ID, ATTR_TEXT
from homeassistant.components.conversation import SERVICE_PROCESS as CONVERSATION_SERVICE
from homeassistant.components.conversation.const import DOMAIN as CONVERSATION_DOMAIN
from homeassistant.components.media_player import MediaPlayerEnqueue
from homeassistant.config_entries import ConfigEntryState
from homeassistant.core import HomeAssistant, State
from homeassistant.helpers import area_registry as ar
Expand Down Expand Up @@ -102,14 +102,10 @@ async def _parse_query_and_return_appropriate_response(
json_payload = json.loads(ai_response["response"]["speech"]["plain"]["speech"])
media_id = json_payload.get(ATTR_MEDIA_ID)
media_type = json_payload.get(ATTR_MEDIA_TYPE)
if isinstance(media_id, str) and media_type == "track":
enqueue = MediaPlayerEnqueue.PLAY
else:
enqueue = MediaPlayerEnqueue.REPLACE
await actual_player.async_play_media(
media_type=media_type,
media_id=media_id,
enqueue=enqueue,
enqueue=None,
extra={ATTR_RADIO_MODE: False},
)
response.response_type = intent.IntentResponseType.ACTION_DONE
Expand Down
Loading