Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="908">
<Macro Name="Generate Slot Events" Expanded="True">
<Event Name="TCP.Changer1.*">
</Event>
<Action>
EventGhost.PythonScript(u'event = eg.event.string\nparts = event.split(".")\nif len(parts) == 3 and parts[-2] == \'Changer1\':\n device = parts[-2]\n slot = parts[-1]\n print device\n if slot.isdigit():\n slot = slot.zfill(3) \n for digit in slot:\n eg.TriggerEvent(\'Num\' + \'-\' + digit,prefix=device)')
</Action>
</Macro>
</EventGhost>
Basically I have my changer mapped as channels 400-800 on my SageTV setup.
Sage generates the events just fine but it provides the channel in the guide, to keep confusion and channel remapping to a minimum I used slot#+400 so my DVDs show as channels 400-800. To come back to the DVD changer I need to subtract that 400 but I can't figure out how to do it.
So
slot = (parts[-1] - 400)
or
slot1 = parts[-1]
slot = int(slot1) - 400
is my guesses however I have no python knowledge and am basically self teaching.

