Kodi Community Forum

Full Version: Overwrite shutdown menu functions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, I'm use Yatse for Kodi and this is very good remote controler. But I would like overwrite Yatse power menu list.

I think about "restart", "power off" and "exit". I don't want turn off/restart my server where running Kodi and overwrite these functions to run turn off projector and exit Kodi.

How to replace exit function in Kodi sent from Yatse? How Yatse send signal/data to Kodi for exit/turn off/restart?

I hanged function button in Kodi, but how to hange "remote" functions?

DialogButtonMenu.xml:
```
<control type="panel" id="9000">
    <include>ButtonMenuList</include>
        <content>
            <item>
                <label>$LOCALIZE[13012]</label>
                <onclick>RunScript("C:\Program Files\Kodi\addons\script.3d.control\exit.py")</onclick>
                <visible>System.ShowExitButton</visible>
            </item>
.....
```

exit.py:
```
import xbmc
import time
from telnetlib import Telnet

projdwn = Telnet('192.168.0.90', 1025)
projup = Telnet('192.168.0.91', 1025)

projdwn.write(b"TongueOWR ?\r\n")
projup.write(b"TongueOWR ?\r\n")

dw = str(projdwn.read_some());
up = str(projup.read_some());

while 'POWR 000000' not in dw or 'POWR 000000' not in up:
    if 'POWR 000000' not in dw:
        projdwn.write(b"TongueOWR 0\r\n")
    if 'POWR 000000' not in up:
        projup.write(b"TongueOWR 0\r\n")
        
    time.sleep(3)
        
    projdwn.write(b"TongueOWR ?\r\n")
    projup.write(b"TongueOWR ?\r\n")
    
    dw = str(projdwn.read_some());
    up = str(projup.read_some());


xbmc.executebuiltin('Quit()')
```