Some fixes
This commit is contained in:
parent
49c53b0f93
commit
6e42689a91
2 changed files with 9 additions and 3 deletions
|
@ -26,7 +26,7 @@ class MatrixDisplay:
|
||||||
Args:
|
Args:
|
||||||
contrast (int): [0, 255]
|
contrast (int): [0, 255]
|
||||||
"""
|
"""
|
||||||
super().set_contrast(contrast)
|
self.contrast = contrast
|
||||||
self.device.contrast(self.contrast)
|
self.device.contrast(self.contrast)
|
||||||
|
|
||||||
def show_text(self, text):
|
def show_text(self, text):
|
||||||
|
|
10
src/main.py
10
src/main.py
|
@ -5,7 +5,13 @@ from typing import Optional
|
||||||
from fastapi import FastAPI
|
from fastapi import FastAPI
|
||||||
from fastapi.middleware.cors import CORSMiddleware
|
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 config import climate_log_file
|
||||||
from handler.action_queue import ActionQueue
|
from handler.action_queue import ActionQueue
|
||||||
from handler.history import get_recent_entries
|
from handler.history import get_recent_entries
|
||||||
|
@ -93,7 +99,7 @@ async def flash(count: int = 1, contrast: Optional[int] = None):
|
||||||
@app.post("/pattern")
|
@app.post("/pattern")
|
||||||
async def flash(pattern: str="0,1", off_ms: int = 500, on_ms: int = 500):
|
async def flash(pattern: str="0,1", off_ms: int = 500, on_ms: int = 500):
|
||||||
await queue.set_idle_action(
|
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."}
|
return {"message": "Activated pattern."}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue