mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
"unavailable" Media players should be considered off in Universal player (#14466)
The Universal media player inherits the states of the first child player that is not in some sort of "Off" state (including idle.) It was not considering the "unavailable" state to be off. Now it does.
This commit is contained in:
parent
6ba49e12a2
commit
5ff5c73e2b
@ -30,7 +30,8 @@ from homeassistant.const import (
|
|||||||
SERVICE_MEDIA_PLAY, SERVICE_MEDIA_PLAY_PAUSE, SERVICE_MEDIA_PREVIOUS_TRACK,
|
SERVICE_MEDIA_PLAY, SERVICE_MEDIA_PLAY_PAUSE, SERVICE_MEDIA_PREVIOUS_TRACK,
|
||||||
SERVICE_MEDIA_SEEK, SERVICE_TURN_OFF, SERVICE_TURN_ON, SERVICE_VOLUME_DOWN,
|
SERVICE_MEDIA_SEEK, SERVICE_TURN_OFF, SERVICE_TURN_ON, SERVICE_VOLUME_DOWN,
|
||||||
SERVICE_VOLUME_MUTE, SERVICE_VOLUME_SET, SERVICE_VOLUME_UP,
|
SERVICE_VOLUME_MUTE, SERVICE_VOLUME_SET, SERVICE_VOLUME_UP,
|
||||||
SERVICE_SHUFFLE_SET, STATE_IDLE, STATE_OFF, STATE_ON, SERVICE_MEDIA_STOP)
|
SERVICE_SHUFFLE_SET, STATE_IDLE, STATE_OFF, STATE_ON, STATE_UNAVAILABLE,
|
||||||
|
SERVICE_MEDIA_STOP)
|
||||||
from homeassistant.helpers import config_validation as cv
|
from homeassistant.helpers import config_validation as cv
|
||||||
from homeassistant.helpers.service import async_call_from_config
|
from homeassistant.helpers.service import async_call_from_config
|
||||||
|
|
||||||
@ -45,7 +46,7 @@ CONF_SERVICE_DATA = 'service_data'
|
|||||||
ATTR_DATA = 'data'
|
ATTR_DATA = 'data'
|
||||||
CONF_STATE = 'state'
|
CONF_STATE = 'state'
|
||||||
|
|
||||||
OFF_STATES = [STATE_IDLE, STATE_OFF]
|
OFF_STATES = [STATE_IDLE, STATE_OFF, STATE_UNAVAILABLE]
|
||||||
REQUIREMENTS = []
|
REQUIREMENTS = []
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user