remove dial through notification
All checks were successful
Build and push image for doorman-homeassistant / diff (push) Successful in 14s
Build and push Doorman UI / API / diff (push) Successful in 11s
Build and push image for doorman-homeassistant / docker (push) Has been skipped
Build and push image for doorman-homeassistant / deploy-gitainer (push) Has been skipped
Build and push Doorman UI / API / twilio (push) Successful in 2m40s
All checks were successful
Build and push image for doorman-homeassistant / diff (push) Successful in 14s
Build and push Doorman UI / API / diff (push) Successful in 11s
Build and push image for doorman-homeassistant / docker (push) Has been skipped
Build and push image for doorman-homeassistant / deploy-gitainer (push) Has been skipped
Build and push Doorman UI / API / twilio (push) Successful in 2m40s
This commit is contained in:
parent
6cc92a3ffb
commit
8aa1fa7b08
@ -68,6 +68,7 @@ const doorConfig: DoorConfig = {
|
||||
SK: "config",
|
||||
buzzer: testDoorBuzzer,
|
||||
pressKey: "4",
|
||||
// discordUsers: ["245290492760162304"],
|
||||
discordUsers: [],
|
||||
fallbackNumbers: ["1231231234"],
|
||||
pin: testDoorPin,
|
||||
|
||||
@ -69,8 +69,10 @@ export const handler: ServerlessFunctionSignature<TwilioContext, BuzzerDialEvent
|
||||
}
|
||||
|
||||
// let users know someone is currently buzzing, and allow unlock by discord user
|
||||
let msg = `🔔 Someone is dialing right now @ Door "${config.door}" [Click to unlock](${context.DOORMAN_URL}/api/door/auth?door=${config.door}&key=`;
|
||||
let msgs = config.discordUsers.map((u) =>
|
||||
let msg = `🔔 Someone is dialing now @ Door "${config.door}"\n\n`;
|
||||
|
||||
msg += `Will dial fallback numbers if door remains locked\n[Click to unlock](${context.DOORMAN_URL}/api/door/auth?door=${config.door}&key=`;
|
||||
let msgs = config.discordUsers.map((u: string) =>
|
||||
msg + u + ')'
|
||||
);
|
||||
|
||||
@ -91,7 +93,6 @@ export const handler: ServerlessFunctionSignature<TwilioContext, BuzzerDialEvent
|
||||
const recordPollLatency = getMetricFromRegistry<Summary>(metricsRegistry, BuzzerActivatedMetrics.POLL_LATENCY)
|
||||
.startTimer({ door: config.door });
|
||||
|
||||
|
||||
// prevent multiple polling at once
|
||||
if (pollLock) {
|
||||
return;
|
||||
@ -140,12 +141,6 @@ export const handler: ServerlessFunctionSignature<TwilioContext, BuzzerDialEvent
|
||||
console.log(
|
||||
invokeId + " GracefulFallbackPromise: I was the fastest, so I will attempt to notify discord users before resolving with a call"
|
||||
);
|
||||
await notifyAllDiscord(
|
||||
context,
|
||||
config,
|
||||
`📞 Somebody buzzed the door and it dialed through to fallback phone numbers @ Door "${config.door}"`,
|
||||
metricsRegistry,
|
||||
);
|
||||
resolve(twiml);
|
||||
} else {
|
||||
console.log(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user