diff --git a/custom_components/alexa_media/media_player.py b/custom_components/alexa_media/media_player.py index 81843521..64c58715 100644 --- a/custom_components/alexa_media/media_player.py +++ b/custom_components/alexa_media/media_player.py @@ -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( diff --git a/custom_components/alexa_media/notify.py b/custom_components/alexa_media/notify.py index 218dd680..7474bfa7 100644 --- a/custom_components/alexa_media/notify.py +++ b/custom_components/alexa_media/notify.py @@ -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