Remove Alexa.InputController from devices without supported inputs in Alexa (#31450)
* Yield Alexa.InputController only for supported inputs. * Add Comment. * Comment fix.
This commit is contained in:
parent
119566f280
commit
4602d7370c
3 changed files with 50 additions and 2 deletions
|
@ -526,7 +526,13 @@ class MediaPlayerCapabilities(AlexaEntity):
|
|||
yield AlexaSeekController(self.entity)
|
||||
|
||||
if supported & media_player.SUPPORT_SELECT_SOURCE:
|
||||
yield AlexaInputController(self.entity)
|
||||
inputs = AlexaInputController.get_valid_inputs(
|
||||
self.entity.attributes.get(
|
||||
media_player.const.ATTR_INPUT_SOURCE_LIST, []
|
||||
)
|
||||
)
|
||||
if len(inputs) > 0:
|
||||
yield AlexaInputController(self.entity)
|
||||
|
||||
if supported & media_player.const.SUPPORT_PLAY_MEDIA:
|
||||
yield AlexaChannelController(self.entity)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue