Implement Alexa.SeekController Interface for media_player in Alexa (#28299)

* Implement Alexa.SeekController Interface for Alexa

* Added error handling and duration checks.

* Split out media_player SeekController tests and added error test.
This commit is contained in:
ochlocracy 2019-10-31 05:38:44 -04:00 committed by Pascal Vizeli
parent bfe4a85e9d
commit ff5b070f4b
5 changed files with 190 additions and 9 deletions

View file

@ -52,6 +52,7 @@ from .capabilities import (
AlexaRangeController,
AlexaSceneController,
AlexaSecurityPanelController,
AlexaSeekController,
AlexaSpeaker,
AlexaStepSpeaker,
AlexaTemperatureSensor,
@ -425,6 +426,9 @@ class MediaPlayerCapabilities(AlexaEntity):
yield AlexaPlaybackController(self.entity)
yield AlexaPlaybackStateReporter(self.entity)
if supported & media_player.const.SUPPORT_SEEK:
yield AlexaSeekController(self.entity)
if supported & media_player.SUPPORT_SELECT_SOURCE:
yield AlexaInputController(self.entity)