Python-based time management application with UDP discovery, TCP protocol communication, time sync, and drift monitoring. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
21 lines
490 B
Python
21 lines
490 B
Python
"""TimeReading 데이터클래스"""
|
|
|
|
from dataclasses import dataclass
|
|
from datetime import datetime
|
|
|
|
|
|
@dataclass
|
|
class TimeReading:
|
|
"""시간 읽기 결과"""
|
|
controller_mac: str
|
|
controller_label: str
|
|
pc_time: datetime
|
|
controller_time: datetime
|
|
drift_seconds: float
|
|
|
|
@property
|
|
def drift_display(self) -> str:
|
|
"""오차 표시용 문자열"""
|
|
sign = "+" if self.drift_seconds >= 0 else ""
|
|
return f"{sign}{self.drift_seconds:.1f}초"
|