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:
parent
3f9dbe6845
commit
c8d9b83b24
3 changed files with 165 additions and 101 deletions
|
@ -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 = (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue