Add approval checking
All checks were successful
ci/woodpecker/manual/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/manual/woodpecker Pipeline was successful
This commit is contained in:
parent
f0ca73329b
commit
13faabf01f
@ -76,7 +76,7 @@ async def view_longpoll(request):
|
|||||||
async with app.ctx.db.eventlog.watch(pipeline) as stream:
|
async with app.ctx.db.eventlog.watch(pipeline) as stream:
|
||||||
await response.send("data: watch-stream-opened\n\n")
|
await response.send("data: watch-stream-opened\n\n")
|
||||||
async for event in stream:
|
async for event in stream:
|
||||||
if event["fullDocument"].get("type") == "open-door":
|
if event["fullDocument"].get("type") == "open-door" and event["fullDocument"].get("approved", False):
|
||||||
await response.send("data: %s\n\n" %
|
await response.send("data: %s\n\n" %
|
||||||
event["fullDocument"]["door"])
|
event["fullDocument"]["door"])
|
||||||
except pymongo.errors.PyMongoError as e:
|
except pymongo.errors.PyMongoError as e:
|
||||||
|
Loading…
Reference in New Issue
Block a user