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

Honor DND status #2195

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions custom_components/alexa_media/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -1292,6 +1292,11 @@ async def async_send_tts(self, message, **kwargs):
@_catch_login_errors
async def async_send_announcement(self, message, **kwargs):
"""Send announcement to the media player."""

if self.dnd_state and kwargs.get("dnd", False):
_LOGGER.info("DND active for device %s, ignoring message", self.name)
return

if self.hass:
self.hass.async_create_task(
self.alexa_api.send_announcement(
Expand Down
1 change: 1 addition & 0 deletions custom_components/alexa_media/notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ async def async_send_message(self, message="", **kwargs):
queue_delay=self.hass.data[DATA_ALEXAMEDIA]["accounts"][
account
]["options"].get(CONF_QUEUE_DELAY, DEFAULT_QUEUE_DELAY),
dnd=data["dnd"],
)
)
break
Expand Down