tune: trigger approaching announcement earlier

This commit is contained in:
2026-08-02 19:34:27 +08:00
parent 73f0ba8e69
commit e29cc0c2ba
+4 -4
View File
@@ -2,7 +2,7 @@
-- ============================================================================ -- ============================================================================
-- 1. Configuration & Constants -- 1. Configuration & Constants
-- ============================================================================ -- ============================================================================
local APP_VERSION_TEXT = "v1.0.42" local APP_VERSION_TEXT = "v1.0.43"
local CONFIG = { local CONFIG = {
CLOUD_URL = "ws://stabadmin.fse-media.group", CLOUD_URL = "ws://stabadmin.fse-media.group",
@@ -18,7 +18,7 @@ local CONFIG = {
ALERT_CONFIRM_MS = 60000, ALERT_CONFIRM_MS = 60000,
ALERT_COOLDOWN_MS = 300000, ALERT_COOLDOWN_MS = 300000,
APPROACHING_COOLDOWN_MS = 120000, APPROACHING_COOLDOWN_MS = 120000,
APPROACHING_STABLE_MS = 15000, APPROACHING_STABLE_MS = 5000,
DEBUG = true DEBUG = true
} }
@@ -2590,7 +2590,7 @@ function Main.loop()
if not pending then if not pending then
State.pendingApproaching[announceKey] = { since = now, lastEta = etaSeconds } State.pendingApproaching[announceKey] = { since = now, lastEta = etaSeconds }
else else
if etaSeconds > (tonumber(pending.lastEta) or etaSeconds) + 0.5 then if etaSeconds > (tonumber(pending.lastEta) or etaSeconds) + 3 then
pending.since = now pending.since = now
end end
pending.lastEta = etaSeconds pending.lastEta = etaSeconds
@@ -2723,7 +2723,7 @@ function Main.loop()
if not pending then if not pending then
State.pendingApproaching[announceKey] = { since = now, lastEta = etaSeconds } State.pendingApproaching[announceKey] = { since = now, lastEta = etaSeconds }
else else
if etaSeconds > (tonumber(pending.lastEta) or etaSeconds) + 0.5 then if etaSeconds > (tonumber(pending.lastEta) or etaSeconds) + 3 then
pending.since = now pending.since = now
end end
pending.lastEta = etaSeconds pending.lastEta = etaSeconds