api: debounce multiple mqtt parameter updates for frontend
All checks were successful
Build Container / Build Container (push) Successful in 1m27s
All checks were successful
Build Container / Build Container (push) Successful in 1m27s
This commit is contained in:
parent
c0d6bd4548
commit
8bc4e7f28e
1 changed files with 2 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
|||
from typing import Optional, List, AsyncIterable
|
||||
import logging
|
||||
import secrets
|
||||
import asyncio
|
||||
from datetime import datetime, UTC
|
||||
from fastapi import FastAPI, Request, Response, status
|
||||
from fastapi.responses import RedirectResponse
|
||||
|
|
@ -243,6 +244,7 @@ async def watch_locks(ccujack: deps.CCUJackClient) -> AsyncIterable[List[models.
|
|||
while True:
|
||||
yield await list_locks(ccujack)
|
||||
await ccujack.data_updated.wait()
|
||||
await asyncio.sleep(0.1) # debounce multiple mqtt parameter updates
|
||||
|
||||
|
||||
@app.patch(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue