I am trying to get make a program that reads the serial port and depending on what it reads, it changes between channel 1 and 2. But I can not get the reading of the serial port to work. The "change channel" macros work, I use them in another version where I change the channel with timer and this works. This i what I have done:
Code: Select all
<EventGhost Name="Configuration Tree" Expanded="True" Version="1483" Guid="{A727B266-A0CD-4400-A4A0-13C7950C52B8}" Time="1225278614.25">
<Autostart Name="Autostart" Expanded="True">
<Plugin File="Serial" Identifier="Serial"> gAIoSwFNsARLA0sASwBLAIlYAgAAAFxycQBYBgAAAFNlcmlhbHEBdHECLg== </Plugin>
<Plugin File="USB-UIRT" Identifier="USB_UIRT"> gAKJiImHcQAu </Plugin>
<Action Name="Read Serial port"> EventGhost.PythonScript(u'Serial = eg.plugins.Serial\n\ntransponder = Serial.Read(None, 0.0) \nif transponder == "C042039004023004005006007008009010011012013014015":\n eg.TriggerEvent("Change to channel 2")\nif transponder == "C035028005003004005006007008009010011012013014015":\n eg.TriggerEvent("Change to channel 1")') </Action>
</Autostart>
<Macro Name="Aland -> Sweden" Expanded="True">
<Event Name="Change to channel 2"/>
<Action> USB_UIRT.TransmitIR(u'0000 0071 0000 0012 0061 0020 0010 0020 0010 0010 0010 0010 0030 0030 0010 0010 0021 0020 0011 0010 0021 0011 0010 0011 0010 0020 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0021 0020 0010 0BE1', 1, 0) </Action>
</Macro>
<Macro Name="Sweden -> Aland" Expanded="True">
<Event Name="Change to channel 1"/>
<Action> USB_UIRT.TransmitIR(u'0000 0071 0000 0013 0061 0021 0010 0020 0010 0011 0010 0011 0010 0020 0020 0010 0011 0010 0021 0021 0011 0010 0021 0011 0011 0010 0010 0021 0010 0010 0010 0010 0010 0010 0011 0010 0010 0010 0010 0011 0021 0BE3', 1, 0) </Action>
</Macro>
</EventGhost>Regards perkos