diff --git a/system-status.py b/system-status.py

index 50b17fa..6163a87 100644

--- a/system-status.py

+++ b/system-status.py

@@ -1 +1,46 @@

+from gpiozero import Button

+from signal import pause

+from subprocess import check_call

+from time import sleep

from unicornhatmini import UnicornHATMini

+

+POWER_BUTTON_GPIO_PIN = 5

+HOLD_TIME_IN_SECONDS = 1

+

+

+class SystemStatus:

+ def init(self, hat):

+ self.hat = hat

+ self.hat.set_brightness(0.1)

+

+ def display(self):

+ self.hat.set(0, 0, 0, 0, 50)

+ self.hat.show()

+

+ def terminate(self):

+ self.hat.set_all(10, 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(10, 0, 0)

+ self.hat.show()

+

+

+def poweroff(systemStatus):

+ systemStatus.terminate()

+ sleep(1)

+ check_call(['sudo', 'poweroff'])

+

+

+def main():

+ systemStatus = SystemStatus(UnicornHATMini())

+ powerButton = Button(POWER_BUTTON_GPIO_PIN, hold_time=HOLD_TIME_IN_SECONDS)

+ powerButton.when_held = poweroff(systemStatus)

+ powerButton.display()

+ pause()

+

+

+if name == 'main':

+ main()

Proxy Information
Original URL
gemini://git.cifelli.xyz/system-status/main/pcdiff/2a810ce1ec78fea4d2fbe7eddbcc3c638f895663
Status Code
Success (20)
Meta
text/plain
Capsule Response Time
494.786151 milliseconds
Gemini-to-HTML Time
1.107586 milliseconds

This content has been proxied by September (ba2dc).