From 075159b9edfada8b3be44fe351afaa1b77414cb8 Mon Sep 17 00:00:00 2001 From: Mike Cifelli <1836280-mike-cifelli@users.noreply.gitlab.com> Date: Wed, 16 Jun 2021 20:06:13 -0400 Subject: [PATCH] Fix shutdown logic --- system-status.py | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/system-status.py b/system-status.py index 6446f0f..193b5d8 100644 --- a/system-status.py +++ b/system-status.py @@ -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): - 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() + 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) 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'])