From: will Date: Mon, 19 Aug 2024 17:12:02 +0000 (+0100) Subject: Added some code comments X-Git-Url: https://git.ozva.co.uk/?a=commitdiff_plain;h=065ce71844a34a00979840262b8df4a595ea2c4c;p=doomsday-clock Added some code comments --- diff --git a/clock.py b/clock.py index bf47617..759fbe8 100755 --- 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)