Switch projectors on and off at a specified time
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
607 B

  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("6:00").do(turnAllProjectorsOff)
  15. while True:
  16. schedule.run_pending()
  17. time.sleep(1)