Overwrite shutdown menu functions

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 my server where running Kodi, and I think about remove these options from pover list or overwrite functions.

I also need replace “Exit” option. I have projector and want turn off them on exit Kodi. In Kodi I overwrite menu list and changed function to run turn off projector and exit Kodi.

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

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":POWR ?\r\n")
projup.write(b":POWR ?\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":POWR 0\r\n")
    if 'POWR 000000' not in up:
        projup.write(b":POWR 0\r\n")
        
    time.sleep(3)
        
    projdwn.write(b":POWR ?\r\n")
    projup.write(b":POWR ?\r\n")
    
    dw = str(projdwn.read_some());
    up = str(projup.read_some());


xbmc.executebuiltin('Quit()')

You can’t change individual items but you can remap the button to start a custom command on Kodi.