def test_playing_pausing(self): assert mp.setup(self.hass, {"media_player": {"platform": "demo"}}) assert self.hass.states.is_state(entity_id, "playing") mp.media_pause(self.hass, entity_id) self.hass.pool.block_till_done() assert self.hass.states.is_state(entity_id, "paused") mp.media_play_pause(self.hass, entity_id) self.hass.pool.block_till_done() assert self.hass.states.is_state(entity_id, "playing") mp.media_play_pause(self.hass, entity_id) self.hass.pool.block_till_done() assert self.hass.states.is_state(entity_id, "paused") mp.media_play(self.hass, entity_id) self.hass.pool.block_till_done() assert self.hass.states.is_state(entity_id, "playing")
def test_playing_pausing(self): assert mp.setup(self.hass, {'media_player': {'platform': 'demo'}}) assert self.hass.states.is_state(entity_id, 'playing') mp.media_pause(self.hass, entity_id) self.hass.pool.block_till_done() assert self.hass.states.is_state(entity_id, 'paused') mp.media_play_pause(self.hass, entity_id) self.hass.pool.block_till_done() assert self.hass.states.is_state(entity_id, 'playing') mp.media_play_pause(self.hass, entity_id) self.hass.pool.block_till_done() assert self.hass.states.is_state(entity_id, 'paused') mp.media_play(self.hass, entity_id) self.hass.pool.block_till_done() assert self.hass.states.is_state(entity_id, 'playing')
def test_playing_pausing(self): """Test media_pause.""" assert setup_component( self.hass, mp.DOMAIN, {'media_player': {'platform': 'demo'}}) assert self.hass.states.is_state(entity_id, 'playing') mp.media_pause(self.hass, entity_id) self.hass.block_till_done() assert self.hass.states.is_state(entity_id, 'paused') mp.media_play_pause(self.hass, entity_id) self.hass.block_till_done() assert self.hass.states.is_state(entity_id, 'playing') mp.media_play_pause(self.hass, entity_id) self.hass.block_till_done() assert self.hass.states.is_state(entity_id, 'paused') mp.media_play(self.hass, entity_id) self.hass.block_till_done() assert self.hass.states.is_state(entity_id, 'playing')