mirror of
https://github.com/cjfranko/NTP-Timeturner.git
synced 2025-11-08 18:32:02 +00:00
fix: Display 'TIME LOCK ACTIVE' status for auto-sync
Co-authored-by: aider (gemini/gemini-2.5-pro-preview-05-06) <aider@aider.chat>
This commit is contained in:
parent
992720041b
commit
d814b05a26
1 changed files with 7 additions and 1 deletions
|
|
@ -160,6 +160,8 @@ impl LtcState {
|
|||
pub fn get_sync_status(delta_ms: i64, config: &Config) -> &'static str {
|
||||
if config.timeturner_offset.is_active() {
|
||||
"TIMETURNING"
|
||||
} else if config.auto_sync_enabled {
|
||||
"TIME LOCK ACTIVE"
|
||||
} else if delta_ms.abs() <= 8 {
|
||||
"IN SYNC"
|
||||
} else if delta_ms > 10 {
|
||||
|
|
@ -347,7 +349,11 @@ mod tests {
|
|||
assert_eq!(get_sync_status(-9, &config), "CLOCK BEHIND");
|
||||
assert_eq!(get_sync_status(-100, &config), "CLOCK BEHIND");
|
||||
|
||||
// Test TIMETURNING status
|
||||
// Test auto-sync status
|
||||
config.auto_sync_enabled = true;
|
||||
assert_eq!(get_sync_status(0, &config), "TIME LOCK ACTIVE");
|
||||
|
||||
// Test TIMETURNING status takes precedence
|
||||
config.timeturner_offset = TimeturnerOffset { hours: 1, minutes: 0, seconds: 0, frames: 0, milliseconds: 0 };
|
||||
assert_eq!(get_sync_status(0, &config), "TIMETURNING");
|
||||
assert_eq!(get_sync_status(100, &config), "TIMETURNING");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue