Fix media_player alexa power control bug (#23537)

This commit is contained in:
Pascal Vizeli authored and GitHub committed 2019-04-29 22:40:55 +02:00
1 parent 5e3e730496
commit 4c4f0e38d4
2 files changed
+31 -1

No files matched your search

+5 -1
View File
@@ -911,13 +911,17 @@ class _MediaPlayerCapabilities(_AlexaEntity):
return [_DisplayCategory.TV]
def interfaces(self):
yield _AlexaPowerController(self.entity)
yield _AlexaEndpointHealth(self.hass, self.entity)
supported = self.entity.attributes.get(ATTR_SUPPORTED_FEATURES, 0)
if supported & media_player.const.SUPPORT_VOLUME_SET:
yield _AlexaSpeaker(self.entity)
power_features = (media_player.SUPPORT_TURN_ON |
media_player.SUPPORT_TURN_OFF)
if supported & power_features:
yield _AlexaPowerController(self.entity)
step_volume_features = (media_player.const.SUPPORT_VOLUME_MUTE |
media_player.const.SUPPORT_VOLUME_STEP)
if supported & step_volume_features: