问题描述
我正在用 Python 创建一个脚本,每次收到电子邮件时都会打开我的 Phillips Hue 灯。
我希望我的脚本每 60 秒检查一次电子邮件。我一直无法在任何地方找到一种好方法来执行if received email,then
之类的操作。所有其他方式似乎也在尝试解码消息。
lights = accessing_lights(bridge_ip_var)
while True:
time.sleep(60)
# This would be where there would be some sort of if statement to check if there was an email or not
for light in lights:
lights[light].on = True
lights[light].hue = 7000
lights[light].saturation = 100
time.sleep(3)
for light in lights:
lights[light].on = False
我已经与 smtplib
合作过项目,因此使用它会很理想。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)