This commit is contained in:
2024-08-25 23:47:51 +03:00
parent 2a8932a19f
commit 7ed9f76f15
3 changed files with 33 additions and 6 deletions

View File

@@ -1,11 +1,32 @@
-- keycardOS "bootloader", has no access to basalt
-- intended for checking for updates, and automatically updating basalt if it is missing
local utils = require("utils.lua")
local updater = require("updater.lua")
local mod = {}
KEYPADOS_VERSION = "4.0"
--- @class BootloaderLibs
--- @field log Logger
--- @field updater Updater
--- @field notifier Notifier
--- @field json JsonParser
--- @class Logger
--- @field error fun(...)
--- @field warn fun(...)
--- @field info fun(...)
--- @field debug fun(...)
--- @class Updater
--- @field addEntry fun(path: string, branch: string, url: string)
--- @class JsonParser
--- @field decode fun(s: string): table
--- @field encode fun(s: table): string
--- @class Notifier
--- @field notify fun(priority: "1"|"2"|"3"|"4"|"5", body: string)
---@param blibs BootloaderLibs
function mod.main(blibs)

View File

@@ -2,6 +2,8 @@ local utils = require("utils.lua")
local basalt = require("basalt")
local config = require("config.lua")
local updater = require("updater.lua")
local blibs = require("main").blibs;
--- @type Monitor
local monitor = utils.Cast(peripheral.find("monitor"))
--- @type drive
@@ -38,6 +40,7 @@ local function unlockDoor(ui)
basalt.debug("test")
if ui.pin == config.correctPin then
blibs.notifier.notify("5", "Unlocked door :3 love u");
ui.enterButton:setBackground(colors.green)
ui.pinLabel:setText("Welcome")
redstone.setOutput("front", true)