#232 option to disable flow view screen for legacy setups

This commit is contained in:
Mikayla Fischler
2023-08-20 23:23:23 -04:00
parent 504ee0594f
commit d179920565
6 changed files with 69 additions and 29 deletions

View File

@@ -338,11 +338,21 @@ function iocontrol.fp_has_speaker(has_speaker) io.fp.ps.publish("has_speaker", h
function iocontrol.fp_link_state(state) io.fp.ps.publish("link_state", state) end
-- report monitor connection state
---@param id integer unit ID or 0 for main
---@param id string|integer unit ID for unit monitor, "main" for main monitor, or "flow" for flow monitor
function iocontrol.fp_monitor_state(id, connected)
local name = "main_monitor"
if id > 0 then name = "unit_monitor_" .. id end
io.fp.ps.publish(name, connected)
local name = nil
if id == "main" then
name = "main_monitor"
elseif id == "flow" then
name = "flow_monitor"
elseif type(id) == "number" then
name = "unit_monitor_" .. id
end
if name ~= nil then
io.fp.ps.publish(name, connected)
end
end
-- report PKT firmware version and PKT session connection state