diff --git a/src/handler/matrix_display.py b/src/handler/matrix_display.py index 6629272..ee7d11a 100644 --- a/src/handler/matrix_display.py +++ b/src/handler/matrix_display.py @@ -26,7 +26,7 @@ class MatrixDisplay: Args: contrast (int): [0, 255] """ - super().set_contrast(contrast) + self.contrast = contrast self.device.contrast(self.contrast) def show_text(self, text): diff --git a/src/main.py b/src/main.py index e334d41..4669cb6 100644 --- a/src/main.py +++ b/src/main.py @@ -5,7 +5,13 @@ from typing import Optional from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware -from actions import climate_sensor, display_time, log_temperature, matrix_display +from actions import ( + climate_sensor, + display_time, + log_temperature, + matrix_display, + display_pattern, +) from config import climate_log_file from handler.action_queue import ActionQueue from handler.history import get_recent_entries @@ -93,7 +99,7 @@ async def flash(count: int = 1, contrast: Optional[int] = None): @app.post("/pattern") async def flash(pattern: str="0,1", off_ms: int = 500, on_ms: int = 500): await queue.set_idle_action( - matrix_display.pattern, pattern=pattern, off_ms=off_ms, on_ms=on_ms + display_pattern, pattern=pattern, off_ms=off_ms, on_ms=on_ms ) return {"message": "Activated pattern."}