def GetTime(self):
"""
Get the time this robot is set to
Returns:
A dictionary with the time of day and day of week (dict)
"""
result = self._PostToRobot("get", "time")
day_idx = [idx for idx, day in enumerate(calendar.day_abbr) if day.lower() == result["d"]][0]
return {
"time" : datetime.time(result["h"], result["m"]),
"weekday" : calendar.day_name[day_idx]
}
评论列表
文章目录