use greeting from DDB and fix config query
All checks were successful
Build and push image for doorman-homeassistant / docker (push) Successful in 25s
Build and push Doorman UI / API / docker (push) Successful in 1m22s
Build and push image for doorman-homeassistant / deploy-gitainer (push) Successful in 22s

This commit is contained in:
Martin Dimitrov 2024-11-12 22:05:02 -08:00
parent a227f82adb
commit dccd56bfa5
5 changed files with 6 additions and 4 deletions

View File

@ -70,6 +70,7 @@ exports.handler = async function(context, event, callback) {
fallbackNumbers: config.Item.fallbackNumbers.SS, fallbackNumbers: config.Item.fallbackNumbers.SS,
pressKey: config.Item.pressKey.S, pressKey: config.Item.pressKey.S,
discordUsers: config.Item?.discordUsers?.SS || [], discordUsers: config.Item?.discordUsers?.SS || [],
greeting: config.Item?.greeting.S || "",
}); });
}).catch((e) => { }).catch((e) => {

View File

@ -142,7 +142,7 @@ exports.getDoorConfigCommand = (door) => {
S: `door-${door}`, S: `door-${door}`,
}, },
"SK": { "SK": {
S: "config-update", S: "config",
}, },
}, },
}); });
@ -167,7 +167,7 @@ exports.replaceDoorConfigWithUpdateItem = (newConfigItem) => {
...newConfigItem.Item, ...newConfigItem.Item,
SK: { S: "config" }, SK: { S: "config" },
}; };
delete newItem.approvalId; delete newItem.approvalId;
return new PutItemCommand({ return new PutItemCommand({

View File

@ -254,7 +254,7 @@ export function DoorPage() {
> >
<SpaceBetween size='l' alignItems="center"> <SpaceBetween size='l' alignItems="center">
<TextContent> <TextContent>
That's it! Enter the building and hit floor 11 on the elevator. We are unit 1105, just to the left off the elevator {doorResponse.greeting || "The door is unlocked!"}
</TextContent> </TextContent>
<img src="/Insulin_Nation_Low_Kramer.gif"/> <img src="/Insulin_Nation_Low_Kramer.gif"/>
</SpaceBetween> </SpaceBetween>

View File

@ -4,7 +4,7 @@ import { DoorResponse } from "../types/DoorResponse";
import { useForm } from "react-hook-form"; import { useForm } from "react-hook-form";
import { InputTokenGroup } from "../components/InputTokenGroup"; import { InputTokenGroup } from "../components/InputTokenGroup";
export type DoorEditForm = DoorResponse & { pin: string, fallbackNumber: string, discordUser: string, greeting: string }; export type DoorEditForm = DoorResponse & { pin: string, fallbackNumber: string, discordUser: string };
export const EditPage = () => { export const EditPage = () => {
const doorResponse = useLoaderData() as DoorResponse; const doorResponse = useLoaderData() as DoorResponse;

View File

@ -6,4 +6,5 @@ export interface DoorResponse {
pressKey: string; pressKey: string;
discordUsers: string[]; discordUsers: string[];
buzzer: string; buzzer: string;
greeting: string;
}; };