Bugfix for media player supported media commands

This commit is contained in:
Paulus Schoutsen 2015-06-11 00:17:44 -07:00
parent 2ea195a5d2
commit cac1c0d415
2 changed files with 4 additions and 2 deletions

View File

@ -167,7 +167,7 @@
},
computeHidePowerButton: function(isOff, supportsTurnOn, supportsTurnOff) {
return isOff && !supportsTurnOn || !isOff && supportsTurnOff;
return isOff ? !supportsTurnOn : !supportsTurnOff;
},
handleTogglePower: function() {

View File

@ -487,7 +487,9 @@ class MediaPlayerDevice(Entity):
def state_attributes(self):
""" Return the state attributes. """
if self.state == STATE_OFF:
state_attr = {}
state_attr = {
ATTR_SUPPORTED_MEDIA_COMMANDS: self.supported_media_commands,
}
else:
state_attr = {
attr: getattr(self, attr) for attr