add /open-all-doors

This commit is contained in:
rasmus 2023-08-17 22:04:20 +03:00
parent 2134512805
commit cdfe6373e1

View File

@ -71,7 +71,7 @@ def view_slack_doorboy():
command = request.form.get("command")
try:
door = {
"/open-new-door": "backdoor",
"/open-all-doors": "outsidedoors",
"/open-back-door": "backdoor",
"/open-front-door": "frontdoor",
"/open-ground-door": "grounddoor",
@ -91,6 +91,12 @@ def view_slack_doorboy():
else:
access_group = "k-space:floor"
approved = access_group in member.groups
doors = [door]
if door == "outsidedoors":
doors = ["backdoor", "frontdoor", "grounddoor"]
for door in doors:
db.eventlog.insert_one({
"method": "slack",
"approved": approved,