My TV only have a Power Toggle command.
I created a "Start System" macro which turns the tv on, switch to the right input etc.
When i press this button again, the tv turns off - not good.
My thoughts are, make a phyton script with a branch if a variable is set (system already on)
and terminate the macro "Start System".
If the variable is not set, then set the variable and execute the macro.
Question is, how is the right syntax of the script - if this is the right way to do it.
Perhaps there is a better way.
Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
run once at keypress but not again at keypress
Re: run once at keypress but not again at keypress
There really isn't a good way if the only IR signal is power toggle. However, a lot of TV's have discrete on/off signals, even if the remote doesn't include the button. I would check remotecentralfor your TV and see if they have more codes.
Brett
Brett
Re: run once at keypress but not again at keypress
This answer is not the way for me.
There is no other command, and i want to use EG to deal with the problem.
There is no other command, and i want to use EG to deal with the problem.
Re: run once at keypress but not again at keypress
in the autoRun put a python command:
make a macro with python script:
note that this code is not tested
but this is basically it!
good luck!
Code: Select all
eg.globals.TVisON="false"Code: Select all
if eg.globals.TVisON=="true":
eg.plugins.EventGhost.TriggerEvent(u'Event_If_TV_is_on', 0.0)
else:
# here you need to switch the tv on
eg.globals.TVisON="true"
eg.plugins.EventGhost.TriggerEvent(u'Event_switch_tv_on', 0.0)
note that this code is not tested
but this is basically it!
good luck!