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