From 45f0911640455384359a508bc246dcfdd75e5a2c Mon Sep 17 00:00:00 2001 From: Jon Maddox Date: Thu, 8 Oct 2015 20:37:59 -0400 Subject: [PATCH] move play_media to the top so it catches first --- homeassistant/helpers/state.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/homeassistant/helpers/state.py b/homeassistant/helpers/state.py index 6526fe2d90b..24a37c5b5ea 100644 --- a/homeassistant/helpers/state.py +++ b/homeassistant/helpers/state.py @@ -59,14 +59,14 @@ def reproduce_state(hass, states, blocking=False): state.entity_id) continue - if state.domain == 'media_player' and state.state == STATE_PAUSED: - service = SERVICE_MEDIA_PAUSE - elif state.domain == 'media_player' and state.state == STATE_PLAYING: - service = SERVICE_MEDIA_PLAY - elif state.domain == 'media_player' and state.attributes and \ + if state.domain == 'media_player' and state.attributes and \ 'media_type' in state.attributes and \ 'media_id' in state.attributes: service = SERVICE_PLAY_MEDIA + elif state.domain == 'media_player' and state.state == STATE_PAUSED: + service = SERVICE_MEDIA_PAUSE + elif state.domain == 'media_player' and state.state == STATE_PLAYING: + service = SERVICE_MEDIA_PLAY elif state.state == STATE_ON: service = SERVICE_TURN_ON elif state.state == STATE_OFF: