Update StepSpeaker and Speaker interfaces in Alexa (#31444)

* Yield only one Speaker interface.

* Yield PowerController only is supported.

* Revert "Yield PowerController only is supported."

This reverts commit c0dbf7e4

* Add Alexa.Speaker interface properties.

* Refactor tests for Alexa.Speaker and Alexa.StepSpeaker.

* Code Smell Change.

* Fix R1705: Unnecessary "elif" after "return".
This commit is contained in:
ochlocracy 2020-02-03 17:20:39 -05:00 committed by GitHub
parent 3f9dbe6845
commit c8d9b83b24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 165 additions and 101 deletions

View file

@ -508,12 +508,7 @@ class MediaPlayerCapabilities(AlexaEntity):
supported = self.entity.attributes.get(ATTR_SUPPORTED_FEATURES, 0)
if supported & media_player.const.SUPPORT_VOLUME_SET:
yield AlexaSpeaker(self.entity)
step_volume_features = (
media_player.const.SUPPORT_VOLUME_MUTE
| media_player.const.SUPPORT_VOLUME_STEP
)
if supported & step_volume_features:
elif supported & media_player.const.SUPPORT_VOLUME_STEP:
yield AlexaStepSpeaker(self.entity)
playback_features = (