Skip to content

Commit 9c45ffe

Browse files
committed
http: api: devices: fix time sync protocol parsing
1 parent d802168 commit 9c45ffe

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/enapter/http/api/devices/communication_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def from_dto(cls, dto: Dict[str, Any]) -> "CommunicationConfig":
3737
mqtt_port=int(dto["mqtt_port"]),
3838
mqtt_credentials=mqtt_credentials,
3939
mqtt_protocol=mqtt_protocol,
40-
time_sync_protocol=dto["time_sync_protocol"],
40+
time_sync_protocol=TimeSyncProtocol(dto["time_sync_protocol"].upper()),
4141
time_sync_host=dto["time_sync_host"],
4242
time_sync_port=int(dto["time_sync_port"]),
4343
hardware_id=dto["hardware_id"],

src/enapter/http/api/devices/time_sync_protocol.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
class TimeSyncProtocol(enum.Enum):
55

6-
HTTP = "HTTP"
6+
NTP = "NTP"

0 commit comments

Comments
 (0)