diff --git a/inventoryManager.lua b/inventoryManager.lua index 2932924..07b1dc5 100644 --- a/inventoryManager.lua +++ b/inventoryManager.lua @@ -195,11 +195,11 @@ local function main() end -- Billboard monitor (optional — set billboardMonitorSide in .manager_config) - if cfg.BILLBOARD_MONITOR_SIDE ~= "" then + if cfg.BILLBOARD_MONITOR ~= "" then if display.setupBillboardMonitor() then log.info("INIT", "Billboard monitor: %s", display.billboardMonName) else - log.warn("INIT", "Billboard monitor not found: %s", cfg.BILLBOARD_MONITOR_SIDE) + log.warn("INIT", "Billboard monitor not found: %s", cfg.BILLBOARD_MONITOR) end end diff --git a/manager/config.lua b/manager/config.lua index f48897f..c269ed7 100644 --- a/manager/config.lua +++ b/manager/config.lua @@ -34,7 +34,7 @@ C.COMPOST_INTERVAL = 3 C.ALERT_INTERVAL = 15 C.CACHE_FILE = _configPath(".inventory_cache") C.SMELTER_MONITOR_SIDE = "top" -C.BILLBOARD_MONITOR_SIDE = "" -- e.g. "monitor_0"; empty = disabled +C.BILLBOARD_MONITOR = "" -- network name e.g. "monitor_0"; empty = disabled C.BILLBOARD_TOP_ITEMS = 20 -- max items in billboard bar chart C.DISABLED_RECIPES_FILE = _configPath(".disabled_recipes") @@ -120,7 +120,7 @@ function C.loadConfig() if cfg.barrelName then C.BARREL_NAME = cfg.barrelName end if cfg.monitorSide then C.MONITOR_SIDE = cfg.monitorSide end if cfg.smelterMonitorSide then C.SMELTER_MONITOR_SIDE = cfg.smelterMonitorSide end - if cfg.billboardMonitorSide then C.BILLBOARD_MONITOR_SIDE = cfg.billboardMonitorSide end + if cfg.billboardMonitor then C.BILLBOARD_MONITOR = cfg.billboardMonitor end if cfg.billboardTopItems then C.BILLBOARD_TOP_ITEMS = cfg.billboardTopItems end if cfg.pollInterval then C.POLL_INTERVAL = cfg.pollInterval end if cfg.scanInterval then C.SCAN_INTERVAL = cfg.scanInterval end diff --git a/manager/display.lua b/manager/display.lua index a8a3bb3..588f3c2 100644 --- a/manager/display.lua +++ b/manager/display.lua @@ -163,25 +163,16 @@ function D.setupSmelterMonitor() end function D.setupBillboardMonitor() - if not cfg.BILLBOARD_MONITOR_SIDE or cfg.BILLBOARD_MONITOR_SIDE == "" then + if not cfg.BILLBOARD_MONITOR or cfg.BILLBOARD_MONITOR == "" then return false end - local mon = peripheral.wrap(cfg.BILLBOARD_MONITOR_SIDE) + local mon = peripheral.wrap(cfg.BILLBOARD_MONITOR) if mon and mon.setTextScale then D.billboardMon = mon - D.billboardMonName = cfg.BILLBOARD_MONITOR_SIDE + D.billboardMonName = cfg.BILLBOARD_MONITOR D.billboardMon.setTextScale(0.5) return true end - -- Fallback: try to find a monitor with that name on the network - for _, name in ipairs(peripheral.getNames()) do - if name == cfg.BILLBOARD_MONITOR_SIDE and peripheral.getType(name) == "monitor" then - D.billboardMon = peripheral.wrap(name) - D.billboardMonName = name - D.billboardMon.setTextScale(0.5) - return true - end - end return false end