From 5dbd3d667faf3f33587dd84b7e2f837c06b2788a Mon Sep 17 00:00:00 2001 From: HenryDu8133 <813367384@qq.com> Date: Mon, 3 Aug 2026 09:24:58 +0800 Subject: [PATCH] fix: restore speaker peripheral detection Re-add speaker discovery during peripheral init so installed speakers are available for playback and log the detected count at startup. --- station_broadcast.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/station_broadcast.lua b/station_broadcast.lua index afc2b41..b42fe99 100644 --- a/station_broadcast.lua +++ b/station_broadcast.lua @@ -120,6 +120,7 @@ function Peripherals.init() State.hasPrimaryMonitor = false end + Peripherals.speakers = { peripheral.find("speaker") } Peripherals.createTarget = peripheral.find("create_target") if Peripherals.createTarget then @@ -2971,6 +2972,11 @@ if Peripherals.primaryMonitor then else Utils.log("WARN", "No monitor detected; running in terminal-only mode") end +if Peripherals.speakers and #Peripherals.speakers > 0 then + Utils.log("INFO", "Speaker detected x" .. tostring(#Peripherals.speakers)) +else + Utils.log("WARN", "No speaker detected") +end parallel.waitForAny( function()