'Turn the media player on.'

def turn_on(self):

    import pexpect
    if (self._player_state != STATE_OFF):
        return
    self._pianobar = pexpect.spawn('pianobar')
    _LOGGER.info('Started    pianobar    subprocess')
    mode = self._pianobar.expect(['Receiving    new    playlist', 'Select    station:', 'Email:'])
    if (mode == 1):
        self._pianobar.sendcontrol('m')
    elif (mode == 2):
        _LOGGER.warning('The    pianobar    client    is    not    configured    to    log    in.    Please    create    a    config    file    for    it    as    described    at    https://home-assistant.io/components/media_player.pandora/')
        self._pianobar.sendcontrol('m')
        self._pianobar.sendcontrol('m')
        self._pianobar.terminate()
        self._pianobar = None
        return
    self._update_stations()
    self.update_playing_status()
    self._player_state = STATE_IDLE
    self.schedule_update_ha_state()
