pandora.py 文件源码

python
阅读 49 收藏 0 点赞 0 评论 0

项目:homeassistant 作者: NAStools 项目源码 文件源码
def turn_off(self):
        """Turn the media player off."""
        import pexpect
        if self._pianobar is None:
            _LOGGER.info('Pianobar subprocess already stopped')
            return
        self._pianobar.send('q')
        try:
            _LOGGER.info('Stopped Pianobar subprocess')
            self._pianobar.terminate()
        except pexpect.exceptions.TIMEOUT:
            # kill the process group
            os.killpg(os.getpgid(self._pianobar.pid), signal.SIGTERM)
            _LOGGER.info('Killed Pianobar subprocess')
        self._pianobar = None
        self._player_state = STATE_OFF
        self.schedule_update_ha_state()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号