fix: trigger approaching broadcast under 30 seconds
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
-- ============================================================================
|
||||
-- 1. Configuration & Constants
|
||||
-- ============================================================================
|
||||
local APP_VERSION_TEXT = "v1.0.35"
|
||||
local APP_VERSION_TEXT = "v1.0.36"
|
||||
|
||||
local CONFIG = {
|
||||
CLOUD_URL = "ws://stabadmin.fse-media.group",
|
||||
@@ -2524,7 +2524,7 @@ function Main.loop()
|
||||
reason = reason
|
||||
})
|
||||
|
||||
if etaSeconds >= 0 and etaSeconds <= 45 then
|
||||
if etaSeconds >= 0 and etaSeconds < 30 then
|
||||
if not State.announcedApproaching[announceKey] then
|
||||
State.announcedApproaching[announceKey] = now
|
||||
Utils.log("INFO", string.format("Train Approaching: %s (ETA: %ds, Delay: %dm)", trainName, etaSeconds, delayMinutes))
|
||||
@@ -2609,8 +2609,8 @@ function Main.loop()
|
||||
reason = nil
|
||||
})
|
||||
|
||||
-- 触发逻辑:当 ETA 已经明确 <= 45秒(包括30秒、15秒、现在等),且之前没有播报过
|
||||
if etaSeconds >= 0 and etaSeconds <= 45 then
|
||||
-- 触发逻辑:当 ETA 已经明确小于30秒(包括15秒、现在等),且之前没有播报过
|
||||
if etaSeconds >= 0 and etaSeconds < 30 then
|
||||
if not State.announcedApproaching[announceKey] then
|
||||
State.announcedApproaching[announceKey] = now
|
||||
Utils.log("INFO", string.format("Train Approaching: %s (ETA: %ds, Delay: %dm)", tName, etaSeconds, delay))
|
||||
|
||||
Reference in New Issue
Block a user