mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 02:07:09 +00:00
moar constants
This commit is contained in:
parent
4a8bbc52e0
commit
082920abe0
@ -10,6 +10,7 @@ from homeassistant.core import State
|
|||||||
import homeassistant.util.dt as dt_util
|
import homeassistant.util.dt as dt_util
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
STATE_ON, STATE_OFF, SERVICE_TURN_ON, SERVICE_TURN_OFF,
|
STATE_ON, STATE_OFF, SERVICE_TURN_ON, SERVICE_TURN_OFF,
|
||||||
|
SERVICE_MEDIA_PLAY, SERVICE_MEDIA_PAUSE,
|
||||||
STATE_PLAYING, STATE_PAUSED, ATTR_ENTITY_ID)
|
STATE_PLAYING, STATE_PAUSED, ATTR_ENTITY_ID)
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
@ -57,9 +58,9 @@ def reproduce_state(hass, states, blocking=False):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
if state.domain == 'media_player' and state == STATE_PAUSED:
|
if state.domain == 'media_player' and state == STATE_PAUSED:
|
||||||
service = 'media_pause'
|
service = SERVICE_MEDIA_PAUSE
|
||||||
elif state.domain == 'media_player' and state == STATE_PLAYING:
|
elif state.domain == 'media_player' and state == STATE_PLAYING:
|
||||||
service = 'media_play'
|
service = SERVICE_MEDIA_PLAY
|
||||||
else
|
else
|
||||||
if state.state == STATE_ON:
|
if state.state == STATE_ON:
|
||||||
service = SERVICE_TURN_ON
|
service = SERVICE_TURN_ON
|
||||||
|
Loading…
x
Reference in New Issue
Block a user