life360.py 文件源码

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

项目:homeassistant-config 作者: arsaboo 项目源码 文件源码
def exec_shell_command( self, command ):

        output = None
        try:
            output = subprocess.check_output( command, shell=True, timeout=60 )
            output = output.strip().decode('utf-8')

        except subprocess.CalledProcessError:
            """ _LOGGER.error("Command failed: %s", command)"""
            self.value = CONST_STATE_ERROR
            output = None
        except subprocess.TimeoutExpired:
            """ _LOGGER.error("Timeout for command: %s", command)"""
            self.value = CONST_STATE_ERROR
            output = None

        if output == None:
            _LOGGER.error( "Life360 has not responsed well. Nothing to worry, will try again!" )
            self.value = CONST_STATE_ERROR
            return None
        else:
            return output
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号