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

This commit is contained in:
Martin Dimitrov 2025-10-24 17:48:28 -07:00
parent 6cc92a3ffb
commit 8aa1fa7b08
2 changed files with 5 additions and 9 deletions

View File

@ -68,6 +68,7 @@ const doorConfig: DoorConfig = {
SK: "config", SK: "config",
buzzer: testDoorBuzzer, buzzer: testDoorBuzzer,
pressKey: "4", pressKey: "4",
// discordUsers: ["245290492760162304"],
discordUsers: [], discordUsers: [],
fallbackNumbers: ["1231231234"], fallbackNumbers: ["1231231234"],
pin: testDoorPin, pin: testDoorPin,

View File

@ -69,8 +69,10 @@ export const handler: ServerlessFunctionSignature<TwilioContext, BuzzerDialEvent
} }
// let users know someone is currently buzzing, and allow unlock by discord user // 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 msg = `🔔 Someone is dialing now @ Door "${config.door}"\n\n`;
let msgs = config.discordUsers.map((u) =>
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 + ')' msg + u + ')'
); );
@ -91,7 +93,6 @@ export const handler: ServerlessFunctionSignature<TwilioContext, BuzzerDialEvent
const recordPollLatency = getMetricFromRegistry<Summary>(metricsRegistry, BuzzerActivatedMetrics.POLL_LATENCY) const recordPollLatency = getMetricFromRegistry<Summary>(metricsRegistry, BuzzerActivatedMetrics.POLL_LATENCY)
.startTimer({ door: config.door }); .startTimer({ door: config.door });
// prevent multiple polling at once // prevent multiple polling at once
if (pollLock) { if (pollLock) {
return; return;
@ -140,12 +141,6 @@ export const handler: ServerlessFunctionSignature<TwilioContext, BuzzerDialEvent
console.log( console.log(
invokeId + " GracefulFallbackPromise: I was the fastest, so I will attempt to notify discord users before resolving with a call" 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); resolve(twiml);
} else { } else {
console.log( console.log(