mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Bugfix for media player supported media commands
This commit is contained in:
parent
2ea195a5d2
commit
cac1c0d415
@ -167,7 +167,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
computeHidePowerButton: function(isOff, supportsTurnOn, supportsTurnOff) {
|
computeHidePowerButton: function(isOff, supportsTurnOn, supportsTurnOff) {
|
||||||
return isOff && !supportsTurnOn || !isOff && supportsTurnOff;
|
return isOff ? !supportsTurnOn : !supportsTurnOff;
|
||||||
},
|
},
|
||||||
|
|
||||||
handleTogglePower: function() {
|
handleTogglePower: function() {
|
||||||
|
@ -487,7 +487,9 @@ class MediaPlayerDevice(Entity):
|
|||||||
def state_attributes(self):
|
def state_attributes(self):
|
||||||
""" Return the state attributes. """
|
""" Return the state attributes. """
|
||||||
if self.state == STATE_OFF:
|
if self.state == STATE_OFF:
|
||||||
state_attr = {}
|
state_attr = {
|
||||||
|
ATTR_SUPPORTED_MEDIA_COMMANDS: self.supported_media_commands,
|
||||||
|
}
|
||||||
else:
|
else:
|
||||||
state_attr = {
|
state_attr = {
|
||||||
attr: getattr(self, attr) for attr
|
attr: getattr(self, attr) for attr
|
||||||
|
Loading…
x
Reference in New Issue
Block a user