Add new process support for reboot message

more_events
Alvaro Neira Ayuso 2019-12-12 18:15:09 +01:00 committed by Alvaro Neira Ayuso
parent 9eabc7f9a8
commit fdf7701a03
2 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,6 @@
def poweroff():
print 'APAGADO'
def reboot():
print 'REBOOT'

View File

@ -11,6 +11,14 @@ class ogProcess():
def processOperation(self, op, URI):
if ("poweroff" in URI):
self.process_poweroff()
elif ("reboot" in URI):
self.process_reboot()
def process_reboot(self):
# Rebooting thread
def rebt():
ogOperations.reboot()
threading.Thread(target=rebt).start()
def process_poweroff(self):
# Powering off thread