Skip to content

Commit ac68ad3

Browse files
committed
Now catches when in a transition
1 parent 44726d5 commit ac68ad3

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

atem.py

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from zeroconf import ServiceBrowser, Zeroconf
1010
import libconf
1111

12-
version = "1.0.0"
12+
version = "1.1.0"
1313

1414
if len(sys.argv) > 1:
1515
if sys.argv[1] == "-v":
@@ -640,6 +640,9 @@ def add_service(self, zeroconf, type, name):
640640
self.info = info
641641
self.is_invalid = False
642642

643+
def update_service(self, zeroconf, type, name):
644+
pass
645+
643646
is_invalid = True
644647
info = None
645648

@@ -666,10 +669,29 @@ def add_service(self, zeroconf, type, name):
666669
def tallyWatch(atem):
667670
if index == -1:
668671
return
669-
tally = atem.state['tally_by_index'][index]
670-
672+
pgm = 0
671673
try:
674+
tally = atem.state['tally'][index]
675+
except KeyError:
676+
return
677+
tally['trn'] = False
678+
for i in (0, 1, 2, 3, 4, 1000, 2001, 2002, 3010, 3011):
679+
try:
680+
if atem.state['tally'][i]['pgm']:
681+
pgm += 1
682+
except KeyError:
683+
pass
684+
685+
if pgm > 1:
672686
if tally['pgm']:
687+
tally['trn'] = True
688+
689+
690+
try:
691+
if tally['trn']:
692+
with open("/tmp/neopixel.state", "w") as file:
693+
file.write("T")
694+
elif tally['pgm']:
673695
with open("/tmp/neopixel.state", "w") as file:
674696
file.write("L")
675697
elif tally['prv']:

0 commit comments

Comments
 (0)