#174 fixed sounder not resuming on supervisor reconnect with same alarm states

This commit is contained in:
Mikayla Fischler 2023-02-25 12:20:03 -05:00
parent 6eee0d0c72
commit 7508acb1a7
2 changed files with 8 additions and 3 deletions

View File

@ -296,6 +296,9 @@ end
function sounder.reconnect(speaker)
alarm_ctl.speaker = speaker
alarm_ctl.playing = false
alarm_ctl.next_block = 1
alarm_ctl.num_active = 0
for id = 1, #TONES do TONES[id].active = false end
end
-- check alarm state to enable/disable alarms

View File

@ -19,7 +19,7 @@ local iocontrol = require("coordinator.iocontrol")
local renderer = require("coordinator.renderer")
local sounder = require("coordinator.sounder")
local COORDINATOR_VERSION = "v0.11.0"
local COORDINATOR_VERSION = "v0.11.1"
local print = util.print
local println = util.println
@ -314,9 +314,10 @@ local function main()
log_comms(msg)
println_ts(msg)
-- close connection and UI
-- close connection, UI, and stop sounder
coord_comms.close()
renderer.close_ui()
sounder.stop()
if not no_modem then
-- try to re-connect to the supervisor
@ -341,9 +342,10 @@ local function main()
if not coord_comms.is_linked() then
log_comms("supervisor closed connection")
-- close connection and UI
-- close connection, UI, and stop sounder
coord_comms.close()
renderer.close_ui()
sounder.stop()
if not no_modem then
-- try to re-connect to the supervisor