__init__.py 文件源码

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

项目:pyirobot 作者: cseelye 项目源码 文件源码
def GetSchedule(self):
        """
        Get the cleaning schedule for this robot

        Returns:
            A dictionary representing the schedule per day (dict)
        """
        res = self._PostToRobot("get", "week")
        schedule = {}
        for idx in range(7):
            cal_day_idx = idx - 1
            if cal_day_idx < 0:
                cal_day_idx = 6
            schedule[calendar.day_name[cal_day_idx]] = {
                "clean" : True if res["cycle"][idx] == "start" else False,
                "startTime" : datetime.time(res["h"][idx], res["m"][idx])
            }
        return schedule
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号