I have two sets of marcos for IR transmits for numbers 0-9, 1 set for top tuner, 2 set for the bottom tuner.
The script is triggered on the event Main.* , SageTV sends an event to EG that is of this format.
Main.STB.STBTop.212
Where 212 is the channel number, and STBTop is the tuner. The other STB I was hoping I could use as the trigger event like Main.STB.* however that does not seem to work. Is that type of wildcard not possible? Right now with Main.* the python script actually triggers itself so I put in some logic in the script to try and finish "quickly" when it triggers it and is not the target event. Seems like having it trigger on such a wide target could cause some performance issues, particularly as I move forward and have more items that it may trigger on. Should I be concerned?
Anyhow my post is two parts:
1. Anything I should do to tweak my script?
2. Is their a way to define the event so that I do not trigger on so much? Right now my event is Main.*
Code: Select all
# get the event
event = eg.EventString
parts = event.split(".")
if len(parts) == 4 and parts[-3] == 'STB':
tuner = parts[-2]
channel = parts[-1]
if channel.isdigit():
channel = channel.zfill(3)
# iterate over every digit
for digit in channel:
# send an event for the digit
eg.TriggerEvent(tuner + '-' + digit)