def test_source_select(self):
        """Test the input source service."""

        entity_id = 'media_player.lounge_room'

        assert mp.setup(self.hass, {'media_player': {'platform': 'demo'}})
        state = self.hass.states.get(entity_id)
        assert 'dvd' == state.attributes.get('source')

        mp.select_source(self.hass, None, entity_id)
        self.hass.pool.block_till_done()
        state = self.hass.states.get(entity_id)
        assert 'dvd' == state.attributes.get('source')

        mp.select_source(self.hass, 'xbox', entity_id)
        self.hass.pool.block_till_done()
        state = self.hass.states.get(entity_id)
        assert 'xbox' == state.attributes.get('source')
Exemple #2
0
    def test_source_select(self):
        """Test the input source service."""

        entity_id = 'media_player.lounge_room'

        assert mp.setup(self.hass, {'media_player': {'platform': 'demo'}})
        state = self.hass.states.get(entity_id)
        assert 'dvd' == state.attributes.get('source')

        mp.select_source(self.hass, None, entity_id)
        self.hass.pool.block_till_done()
        state = self.hass.states.get(entity_id)
        assert 'dvd' == state.attributes.get('source')

        mp.select_source(self.hass, 'xbox', entity_id)
        self.hass.pool.block_till_done()
        state = self.hass.states.get(entity_id)
        assert 'xbox' == state.attributes.get('source')