Switch projectors on and off at a specified time
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

ir-remote-timer.py 608 B

4 年前
4 年前
4 年前
12345678910111213141516171819202122232425262728293031323334
  1. from py_irsend import irsend
  2. import schedule
  3. import time
  4. irsend.list_remotes()
  5. def turnAllProjectorsOn():
  6. print("turn all projectors on ...")
  7. irsend.send_once('logitech_z906', ['POWER'])
  8. irsend.send_once('logitech_z906', ['POWER'])
  9. def turnAllProjectorsOff():
  10. print("turn all projectors off ...")
  11. irsend.send_once('logitech_z906', ['POWER'])
  12. irsend.send_once('logitech_z906', ['POWER'])
  13. schedule.every().day.at("21:00").do(turnAllProjectorsOn)
  14. schedule.every().day.at("06:00").do(turnAllProjectorsOff)
  15. while True:
  16. schedule.run_pending()
  17. time.sleep(1)