Code formating

This commit is contained in:
jeanGaston 2024-06-10 10:13:15 +02:00
parent c4cbae7f68
commit 67a0def870

View File

@ -90,6 +90,7 @@ def display_message(message, ip_address):
print("display error:", e) print("display error:", e)
init_oled() init_oled()
# Function to draw a circle # Function to draw a circle
def draw_circle(oled, x0, y0, radius, color): def draw_circle(oled, x0, y0, radius, color):
x = radius x = radius
@ -106,10 +107,11 @@ def draw_circle(oled, x0, y0, radius, color):
oled.pixel(x0 + y, y0 - x, color) oled.pixel(x0 + y, y0 - x, color)
oled.pixel(x0 + x, y0 - y, color) oled.pixel(x0 + x, y0 - y, color)
y += 1 y += 1
err += 1 + 2*y err += 1 + 2 * y
if 2*(err - x) + 1 > 0: if 2 * (err - x) + 1 > 0:
x -= 1 x -= 1
err += 1 - 2*x err += 1 - 2 * x
# Screensaver function with circular wave animation # Screensaver function with circular wave animation
def screensaver(): def screensaver():
@ -170,7 +172,7 @@ def start_screensaver_thread():
if not screensaver_thread_running: if not screensaver_thread_running:
screensaver_active = True screensaver_active = True
screensaver_thread_running = True screensaver_thread_running = True
_thread.start_new_thread(screensaver,()) _thread.start_new_thread(screensaver, ())
def handle_inactivity(timer): def handle_inactivity(timer):