-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdownshift.py
More file actions
executable file
·27 lines (21 loc) · 857 Bytes
/
downshift.py
File metadata and controls
executable file
·27 lines (21 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import subprocess
import time
import argparse
def downshift(minutes=90, end_temp=2500):
steps = (6500 - end_temp) / 100
intvl = (minutes * 60) / steps
current_temp = 6500
while current_temp > end_temp:
current_temp -= 100
subprocess.run(['sct', str(current_temp)])
print('Temp:', current_temp, end='\r')
time.sleep(intvl)
print('\n\n')
if __name__ == '__main__':
parser = argparse.ArgumentParser(prog='downshift')
parser.add_argument('minutes', type=float, default=90, nargs='?',
help='time over which to shift color temperature; default 90')
parser.add_argument('end_temp', type=int, default=2500, nargs='?',
help='Ending color temperature, from 1000-6500; default 2500')
args = parser.parse_args()
downshift(args.minutes, args.end_temp)