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.
This commit is contained in:
@@ -120,6 +120,7 @@ function Peripherals.init()
|
|||||||
State.hasPrimaryMonitor = false
|
State.hasPrimaryMonitor = false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Peripherals.speakers = { peripheral.find("speaker") }
|
||||||
|
|
||||||
Peripherals.createTarget = peripheral.find("create_target")
|
Peripherals.createTarget = peripheral.find("create_target")
|
||||||
if Peripherals.createTarget then
|
if Peripherals.createTarget then
|
||||||
@@ -2971,6 +2972,11 @@ if Peripherals.primaryMonitor then
|
|||||||
else
|
else
|
||||||
Utils.log("WARN", "No monitor detected; running in terminal-only mode")
|
Utils.log("WARN", "No monitor detected; running in terminal-only mode")
|
||||||
end
|
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(
|
parallel.waitForAny(
|
||||||
function()
|
function()
|
||||||
|
|||||||
Reference in New Issue
Block a user