From 065ce71844a34a00979840262b8df4a595ea2c4c Mon Sep 17 00:00:00 2001 From: will Date: Mon, 19 Aug 2024 18:12:02 +0100 Subject: [PATCH] Added some code comments --- clock.py | 6 ++++++ 1 file changed, 6 insertions(+) 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) -- 2.39.2