feat: Add system date display and setting via API

Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
Chris Frankland-Wright 2025-07-30 22:36:19 +01:00
parent af43388e4b
commit 58a1d243e4
5 changed files with 118 additions and 0 deletions

View file

@ -17,6 +17,7 @@ This document describes the HTTP API for the NTP Timeturner application.
"ltc_timecode": "10:20:30:00",
"frame_rate": "25.00fps",
"system_clock": "10:20:30.005",
"system_date": "2025-07-30",
"timecode_delta_ms": 5,
"timecode_delta_frames": 0,
"sync_status": "IN SYNC",
@ -58,6 +59,33 @@ This document describes the HTTP API for the NTP Timeturner application.
}
```
- **`POST /api/set_date`**
Sets the system date. This is useful as LTC does not contain date information. Requires `sudo` privileges.
**Example Request:**
```json
{
"date": "2025-07-30"
}
```
**Success Response:**
```json
{
"status": "success",
"message": "Date update command issued."
}
```
**Error Response:**
```json
{
"status": "error",
"message": "Date update command failed."
}
```
### Configuration
- **`GET /api/config`**