Fix alexa not discovering devices when sound mode device present (#49628)

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
pull/49628/merge
starkillerOG 2021-05-25 17:35:40 +02:00 committed by GitHub
parent f4dc72c0bd
commit e9ff4b1342
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -40,6 +40,7 @@ from homeassistant.const import (
)
from homeassistant.core import HomeAssistant, State, callback
from homeassistant.helpers import network
from homeassistant.helpers.entity import entity_sources
from homeassistant.util.decorator import Registry
from .capabilities import (
@ -615,7 +616,13 @@ class MediaPlayerCapabilities(AlexaEntity):
if supported & media_player.const.SUPPORT_PLAY_MEDIA:
yield AlexaChannelController(self.entity)
if supported & media_player.const.SUPPORT_SELECT_SOUND_MODE:
# AlexaEqualizerController is disabled for denonavr
# since it blocks alexa from discovering any devices.
domain = entity_sources(self.hass).get(self.entity_id, {}).get("domain")
if (
supported & media_player.const.SUPPORT_SELECT_SOUND_MODE
and domain != "denonavr"
):
inputs = AlexaEqualizerController.get_valid_inputs(
self.entity.attributes.get(media_player.const.ATTR_SOUND_MODE_LIST, [])
)