]> OzVa Git service - doomsday-clock/commitdiff
Added some code comments
authorwill <greenwoodw50@gmail.com>
Mon, 19 Aug 2024 17:12:02 +0000 (18:12 +0100)
committerwill <greenwoodw50@gmail.com>
Mon, 19 Aug 2024 17:12:02 +0000 (18:12 +0100)
clock.py

index bf476173641d2b0714060d573cb81f47ac1b5c58..759fbe891d52d16d6f1366e9edfc896c2ebb7378 100755 (executable)
--- a/clock.py
+++ b/clock.py
@@ -1,12 +1,15 @@
 #!./.venv/bin/python
+
 from http.server import HTTPServer, SimpleHTTPRequestHandler
 from multiprocessing import Process, Array, Value
+import subprocess
 import requests
 import time
 import sacn
 import sys
 import os
 
+# fake GPIO dummy class for debuging
 class dummy():
        def __init__(self):
                self.HIGH = "high"
@@ -30,11 +33,13 @@ class dummy():
 
        def cleanup(self): pass
 
+# use the dummy class as GPIO if the real GPIO module does not exist
 try: import RPi.GPIO
 except ModuleNotFoundError:
        print("RPi.GPIO Not found!\nDefaulting to dummy GPIO...")
        GPIO = dummy()
 
+# main class for handling all clock functions and threads
 class clock():
        def __init__(self):
                # fixed variables
@@ -117,6 +122,7 @@ class clock():
 
        def light(self):
                print("starting lighting service...")
+
                sender = sacn.sACNsender()
                sender.start()
                sender.activate_output(2)