[1mdiff --git a/system-status.py b/system-status.py[m
[1mindex 50b17fa..6163a87 100644[m
[1m--- a/system-status.py[m
[1m+++ b/system-status.py[m
[36m@@ -1 +1,46 @@[m
[32m+[m[32mfrom gpiozero import Button[m
[32m+[m[32mfrom signal import pause[m
[32m+[m[32mfrom subprocess import check_call[m
[32m+[m[32mfrom time import sleep[m
from unicornhatmini import UnicornHATMini[m
[32m+[m
[32m+[m[32mPOWER_BUTTON_GPIO_PIN = 5[m
[32m+[m[32mHOLD_TIME_IN_SECONDS = 1[m
[32m+[m
[32m+[m
[32m+[m[32mclass SystemStatus:[m
[32m+[m[32m def init(self, hat):[m
[32m+[m[32m self.hat = hat[m
[32m+[m[32m self.hat.set_brightness(0.1)[m
[32m+[m
[32m+[m[32m def display(self):[m
[32m+[m[32m self.hat.set(0, 0, 0, 0, 50)[m
[32m+[m[32m self.hat.show()[m
[32m+[m
[32m+[m[32m def terminate(self):[m
[32m+[m[32m self.hat.set_all(10, 0, 0)[m
[32m+[m[32m self.hat.show()[m
[32m+[m[32m sleep(0.25)[m
[32m+[m[32m self.hat.set_all(0, 0, 0)[m
[32m+[m[32m self.hat.show()[m
[32m+[m[32m sleep(0.25)[m
[32m+[m[32m self.hat.set_all(10, 0, 0)[m
[32m+[m[32m self.hat.show()[m
[32m+[m
[32m+[m
[32m+[m[32mdef poweroff(systemStatus):[m
[32m+[m[32m systemStatus.terminate()[m
[32m+[m[32m sleep(1)[m
[32m+[m[32m check_call(['sudo', 'poweroff'])[m
[32m+[m
[32m+[m
[32m+[m[32mdef main():[m
[32m+[m[32m systemStatus = SystemStatus(UnicornHATMini())[m
[32m+[m[32m powerButton = Button(POWER_BUTTON_GPIO_PIN, hold_time=HOLD_TIME_IN_SECONDS)[m
[32m+[m[32m powerButton.when_held = poweroff(systemStatus)[m
[32m+[m[32m powerButton.display()[m
[32m+[m[32m pause()[m
[32m+[m
[32m+[m
[32m+[m[32mif name == 'main':[m
[32m+[m[32m main()[m
text/plain
This content has been proxied by September (ba2dc).