'Turn the media player off.'

def turn_off(self):

    import pexpect
    if (self._pianobar is None):
        _LOGGER.info('Pianobar    subprocess    already    stopped')
        return
    self._pianobar.send('q')
    try:
        _LOGGER.debug('Stopped    Pianobar    subprocess')
        self._pianobar.terminate()
    except pexpect.exceptions.TIMEOUT:
        os.killpg(os.getpgid(self._pianobar.pid), signal.SIGTERM)
        _LOGGER.debug('Killed    Pianobar    subprocess')
    self._pianobar = None
    self._player_state = STATE_OFF
    self.schedule_update_ha_state()
