Fix shutdown logic
This commit is contained in:
parent
4fd45b9f9b
commit
075159b9ed
|
@ -21,30 +21,20 @@ class SystemStatus:
|
||||||
self.hat.show()
|
self.hat.show()
|
||||||
|
|
||||||
def exit(self):
|
def exit(self):
|
||||||
self.hat.set_all(0, 0, 50)
|
self.hat.set_all(50, 0, 0)
|
||||||
self.hat.show()
|
self.hat.show()
|
||||||
sleep(0.25)
|
sleep(0.50)
|
||||||
self.hat.set_all(0, 0, 0)
|
|
||||||
self.hat.show()
|
|
||||||
sleep(0.25)
|
|
||||||
self.hat.set_all(0, 0, 50)
|
|
||||||
self.hat.show()
|
|
||||||
sleep(0.25)
|
|
||||||
self.hat.set_all(0, 0, 0)
|
self.hat.set_all(0, 0, 0)
|
||||||
self.hat.show()
|
self.hat.show()
|
||||||
|
|
||||||
def terminate(self):
|
def terminate(self):
|
||||||
self.hat.set_all(50, 0, 0)
|
for _ in range(3):
|
||||||
self.hat.show()
|
self.hat.set_all(50, 0, 0)
|
||||||
sleep(0.25)
|
self.hat.show()
|
||||||
self.hat.set_all(0, 0, 0)
|
sleep(0.25)
|
||||||
self.hat.show()
|
self.hat.set_all(0, 0, 0)
|
||||||
sleep(0.25)
|
self.hat.show()
|
||||||
self.hat.set_all(50, 0, 0)
|
sleep(0.25)
|
||||||
self.hat.show()
|
|
||||||
sleep(0.25)
|
|
||||||
self.hat.set_all(0, 0, 0)
|
|
||||||
self.hat.show()
|
|
||||||
|
|
||||||
|
|
||||||
def cleanExit(systemStatus, button):
|
def cleanExit(systemStatus, button):
|
||||||
|
@ -58,7 +48,6 @@ def cleanExit(systemStatus, button):
|
||||||
|
|
||||||
def poweroff(systemStatus, button):
|
def poweroff(systemStatus, button):
|
||||||
def terminate():
|
def terminate():
|
||||||
button.close()
|
|
||||||
systemStatus.terminate()
|
systemStatus.terminate()
|
||||||
check_call(['sudo', 'poweroff'])
|
check_call(['sudo', 'poweroff'])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue