content/hifi-content/DomainContent/production/welcomeWagon/wwResetInterval.old.js
2022-02-13 22:49:05 +01:00

26 lines
852 B
JavaScript

print('TimeText = ' + nextCleanupParsedTime.timeText);
print('DepartTimes = ' + JSON.stringify(WELCOME_WAGON_DEPART_TIMES))
var welcomeWagonArriving = (WELCOME_WAGON_DEPART_TIMES.indexOf(nextCleanupParsedTime.timeText) !== -1);
if (!welcomeWagonArriving) {
print('Welcome wagon arrive check.');
} else {
print('Welcome wagon depart check.');
}
var WELCOME_WAGON_CHANNEL = 'com.highfidelity.welcomeWagon';
var STOP_CHECKING_WHEN = {
NEVER: 0,
WELCOME_WAGON_ARRIVES: 1,
WELCOME_WAGON_LEAVES: 2
};
Messages.sendMessage(WELCOME_WAGON_CHANNEL, JSON.stringify({
action: 'check',
forceReset: false,
maxIntervalRuns: 30,
directCheck: true,
interval: 1000,
stopCheckingWhen: !welcomeWagonArriving ? STOP_CHECKING_WHEN.WELCOME_WAGON_ARRIVES : STOP_CHECKING_WHEN.WELCOME_WAGON_LEAVES
}));