force update home
Some checks failed
Build and push image for doorman-homeassistant / diff (push) Successful in 47s
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) Has been cancelled
Some checks failed
Build and push image for doorman-homeassistant / diff (push) Successful in 47s
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) Has been cancelled
This commit is contained in:
parent
09231cd7f7
commit
3d7f30a574
@ -17,10 +17,11 @@ app.get("/api/door/info", async (c) => {
|
|||||||
msg: "Must specify a door",
|
msg: "Must specify a door",
|
||||||
}, 400);
|
}, 400);
|
||||||
}
|
}
|
||||||
|
|
||||||
const db = createDynaBridgeClient(Bun.env as any);
|
const db = createDynaBridgeClient(Bun.env as any);
|
||||||
|
|
||||||
const config = await db.entities.doorConfig.findById(getDoorConfigID(door));
|
const config = await db.entities.doorConfig.findById(getDoorConfigID(door));
|
||||||
|
console.log(config);
|
||||||
|
|
||||||
if (!config) {
|
if (!config) {
|
||||||
return c.json({
|
return c.json({
|
||||||
@ -29,10 +30,10 @@ app.get("/api/door/info", async (c) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const lock = await db.entities.lockStatus.findById(getLockStatusID(door));
|
const lock = await db.entities.lockStatus.findById(getLockStatusID(door));
|
||||||
const status = isLockOpen(lock) ? DoorStatus.OPEN: "CLOSED";
|
const status = isLockOpen(lock) ? DoorStatus.OPEN : "CLOSED";
|
||||||
return c.json({
|
return c.json({
|
||||||
id: door,
|
id: door,
|
||||||
status,
|
status,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user