Revert "Added temporary contrast to pattern endpoint"
This reverts commit 9715339c43
.
This commit is contained in:
parent
aff797bcb5
commit
df102d8e4e
2 changed files with 4 additions and 15 deletions
|
@ -44,12 +44,5 @@ async def display_time():
|
||||||
|
|
||||||
|
|
||||||
async def display_pattern(*args, **kwargs):
|
async def display_pattern(*args, **kwargs):
|
||||||
old_contrast = matrix_display.contrast
|
while True:
|
||||||
if "contrast" in kwargs:
|
await matrix_display.pattern(*args, **kwargs)
|
||||||
matrix_display.set_contrast(int(kwargs["contrast"]))
|
|
||||||
try:
|
|
||||||
while True:
|
|
||||||
await matrix_display.pattern(*args, **kwargs)
|
|
||||||
except:
|
|
||||||
if "contrast" in kwargs:
|
|
||||||
matrix_display.set_contrast(old_contrast)
|
|
||||||
|
|
|
@ -126,12 +126,8 @@ async def flash(count: int = 1, contrast: Optional[int] = None):
|
||||||
|
|
||||||
|
|
||||||
@app.post("/pattern")
|
@app.post("/pattern")
|
||||||
async def flash(
|
async def flash(pattern: str = "01", step_ms: int = 500):
|
||||||
pattern: str = "01", step_ms: int = 500, contrast: Optional[int] = None
|
await queue.set_idle_action(display_pattern, pattern=pattern, step_ms=step_ms)
|
||||||
):
|
|
||||||
await queue.set_idle_action(
|
|
||||||
display_pattern, pattern=pattern, step_ms=step_ms, contrast=contrast
|
|
||||||
)
|
|
||||||
return {"message": "Activated pattern."}
|
return {"message": "Activated pattern."}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue