@@ -69,7 +69,7 @@ def script_properties():
69
69
70
70
video_source_names = list_video_source_names ()
71
71
for source_name in video_source_names :
72
- obs .obs_properties_add_text (props , source_name , source_name + " light addr :" , obs .OBS_TEXT_DEFAULT )
72
+ obs .obs_properties_add_text (props , source_name , source_name + " light(s) :" , obs .OBS_TEXT_DEFAULT )
73
73
74
74
return props
75
75
@@ -91,26 +91,28 @@ def call_tally_light(source, color, brightness):
91
91
92
92
def fetch_command ():
93
93
command = commandQueue .get ()
94
- addr = light_mapping [command ['source' ]]
95
- if not addr :
96
- obs .script_log (obs .LOG_INFO , 'No tally light set for: %s' % (source ))
94
+ addressList = light_mapping [command ['source' ]]
95
+ if not addressList :
96
+ obs .script_log (obs .LOG_INFO , 'No tally light set for: %s' % (command [ ' source' ] ))
97
97
return
98
98
99
99
hexColor = hex (command ['color' ])
100
100
hexBlue = hexColor [4 :6 ]
101
101
hexGreen = hexColor [6 :8 ]
102
102
hexRed = hexColor [8 :10 ]
103
103
pctBright = command ['brightness' ] / 10
104
- url = 'http://%s:7413/set?color=%s%s%s&brightness=%f' % (addr , hexRed , hexGreen , hexBlue , pctBright )
105
-
106
- try :
107
- with urllib .request .urlopen (url , None , http_timeout_seconds ) as response :
108
- data = response .read ()
109
- text = data .decode ('utf-8' )
110
- obs .script_log (obs .LOG_INFO , 'Set %s tally light: %s' % (source , text ))
111
-
112
- except urllib .error .URLError as err :
113
- obs .script_log (obs .LOG_WARNING , 'Error connecting to tally light URL %s: %s' % (url , err .reason ))
104
+ addresses = addressList .split (',' )
105
+
106
+ for address in addresses :
107
+ url = 'http://%s:7413/set?color=%s%s%s&brightness=%f' % (address .strip (), hexRed , hexGreen , hexBlue , pctBright )
108
+ try :
109
+ with urllib .request .urlopen (url , None , http_timeout_seconds ) as response :
110
+ data = response .read ()
111
+ text = data .decode ('utf-8' )
112
+ obs .script_log (obs .LOG_INFO , 'Set %s tally light: %s' % (command ['source' ], text ))
113
+
114
+ except urllib .error .URLError as err :
115
+ obs .script_log (obs .LOG_WARNING , 'Error connecting to tally light URL %s: %s' % (url , err .reason ))
114
116
115
117
def list_video_source_names ():
116
118
sources = obs .obs_enum_sources ()
0 commit comments