mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 05:37:44 +00:00
style
This commit is contained in:
parent
c83324d4cf
commit
26939ce554
@ -189,6 +189,7 @@ def media_previous_track(hass, entity_id=None):
|
|||||||
data = {ATTR_ENTITY_ID: entity_id} if entity_id else {}
|
data = {ATTR_ENTITY_ID: entity_id} if entity_id else {}
|
||||||
hass.services.call(DOMAIN, SERVICE_MEDIA_PREVIOUS_TRACK, data)
|
hass.services.call(DOMAIN, SERVICE_MEDIA_PREVIOUS_TRACK, data)
|
||||||
|
|
||||||
|
|
||||||
def play_media(hass, media_type, media_id, entity_id=None):
|
def play_media(hass, media_type, media_id, entity_id=None):
|
||||||
""" Send the media player the command for playing media. """
|
""" Send the media player the command for playing media. """
|
||||||
data = {"media_type": media_type, "media_id": media_id}
|
data = {"media_type": media_type, "media_id": media_id}
|
||||||
|
@ -65,7 +65,7 @@ def reproduce_state(hass, states, blocking=False):
|
|||||||
service = SERVICE_MEDIA_PLAY
|
service = SERVICE_MEDIA_PLAY
|
||||||
elif state.domain == 'media_player' and state.attributes and \
|
elif state.domain == 'media_player' and state.attributes and \
|
||||||
'media_type' in state.attributes and \
|
'media_type' in state.attributes and \
|
||||||
'media_id' in state.attributes:
|
'media_id' in state.attributes:
|
||||||
service = SERVICE_PLAY_MEDIA
|
service = SERVICE_PLAY_MEDIA
|
||||||
elif state.state == STATE_ON:
|
elif state.state == STATE_ON:
|
||||||
service = SERVICE_TURN_ON
|
service = SERVICE_TURN_ON
|
||||||
|
Loading…
x
Reference in New Issue
Block a user