Message Answer now reaches webinterface
[enigma2-plugins.git] / webinterface / src / WebComponents / Sources / PowerState.py
1 from enigma import *
2 from Components.Sources.Source import Source
3
4
5 class PowerState( Source):
6         
7     def __init__(self,session):
8         self.cmd = []
9         self.session = session
10         Source.__init__(self)
11
12     def handleCommand(self, cmd):
13         self.cmd = cmd
14         print "PowerState:",self.cmd
15         if self.cmd == "" or self.cmd is None:
16             print "the PowerState was not defined (%s)" % self.cmd
17             return [[False,"the PowerState was not defined"]]
18         
19         # 1: poweroff/deepstandby
20         # 2: rebootdreambox
21         # 3: rebootenigma
22         # 4: standby
23         
24         type = int(self.cmd)
25         if type == 0:
26             print "Standby if"
27             from Screens.Standby import Standby
28             self.session.open(Standby)
29         elif type < 4:
30             print "TryQuitMainloop if"
31             from Screens.Standby import TryQuitMainloop
32             self.session.open(TryQuitMainloop, type)
33         else:
34             print "PowerState was not defined correctly (%s)" % type
35
36         #quitMainloop(type)