-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbmd_scheduler.py
58 lines (46 loc) · 1.45 KB
/
bmd_scheduler.py
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
from time import sleep
import schedule
from bmd_router_control import blackmagic_router_control
from functions.display_time import *
# Change the show start and end times here. Use military time, so 1:00 pm = 13:00
city_hall_start = '18:29:50'
gc360_start = '15:59:50'
gc360_end = '16:30:00'
# Setup router command here (put your router's ip below)
router = blackmagic_router_control('192.168.1.30')
# SOURCES (for easier readability)
tricaster_pgm = 6
scala = 9
city_hall = 10
terrell_in = 11
centennial = 12
# DESTINATIONS (for easier readability)
headend = 1
monitor_rack = 8
monitor_record = 9
monitor_playback = 10
recorder = 11
terrell_send = 12
def gc360():
router.route_inputs([
(terrell_in, headend),
(terrell_in, monitor_rack),
(terrell_in, terrell_send)])
def default():
router.route_inputs([
(scala, headend),
(scala, monitor_rack),
(scala, terrell_send)])
schedule.every().day.at(gc360_start).do(gc360)
schedule.every().day.at(gc360_end).do(default)
if __name__ == '__main__':
print('=======================\n Program initialized.\n=======================\n')
while True:
try:
t = schedule.idle_seconds()
print('Time until next switch command:', display_time(t))
except TypeError:
print('\nNo switch scheduled. Exiting.')
break
schedule.run_pending()
sleep(1)