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
-- ============================================================================
local APP_VERSION_TEXT = "v1.0.42"
local APP_VERSION_TEXT = "v1.0.43"
local CONFIG = {
CLOUD_URL = "ws://stabadmin.fse-media.group",
@@ -18,7 +18,7 @@ local CONFIG = {
ALERT_CONFIRM_MS = 60000,
ALERT_COOLDOWN_MS = 300000,
APPROACHING_COOLDOWN_MS = 120000,
APPROACHING_STABLE_MS = 15000,
APPROACHING_STABLE_MS = 5000,
DEBUG = true
}
@@ -2590,7 +2590,7 @@ function Main.loop()
if not pending then
State.pendingApproaching[announceKey] = { since = now, lastEta = etaSeconds }
else
if etaSeconds > (tonumber(pending.lastEta) or etaSeconds) + 0.5 then
if etaSeconds > (tonumber(pending.lastEta) or etaSeconds) + 3 then
pending.since = now
end
pending.lastEta = etaSeconds
@@ -2723,7 +2723,7 @@ function Main.loop()
if not pending then
State.pendingApproaching[announceKey] = { since = now, lastEta = etaSeconds }
else
if etaSeconds > (tonumber(pending.lastEta) or etaSeconds) + 0.5 then
if etaSeconds > (tonumber(pending.lastEta) or etaSeconds) + 3 then
pending.since = now
end
pending.lastEta = etaSeconds