Fix shutdown logic

This commit is contained in:
Mike Cifelli 2021-06-16 20:06:13 -04:00
parent 4fd45b9f9b
commit 075159b9ed
1 changed files with 9 additions and 20 deletions

View File

@ -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'])