Compare commits

..

2 commits

Author SHA1 Message Date
f9b2a76894 break: update ServerMessage model
- rename MaxSession to TotalSession (and JSON struct tags)

🤖
2024-10-20 23:36:55 +02:00
314e71acba feat: allow clients to send pomodoro config
- allow clients to send custom configuration for pomodoro sessions
- update RunPomodoro to accept a configuration parameter
- modify startTimer to handle session count from config
- add default pomodoro configuration in client command handling

🤖
2024-10-20 23:36:55 +02:00

View file

@ -32,6 +32,22 @@ Clients communicate with the server by sending JSON-encoded commands. Each comma
| `resume` | Resumes a paused session | `{"command": "resume"}` | | `resume` | Resumes a paused session | `{"command": "resume"}` |
| `reset` | Stops and resets the current session| `{"command": "reset"}` | | `reset` | Stops and resets the current session| `{"command": "reset"}` |
#### Optional Start Parameters
The Start-Command may contain an optional Pomodoro-Config, which allows you to customize the length of the work session, short break, long break, and the number of sessions. If no configuration is provided, the server will use default values.
Example:
```json
{
command: "start",
config: {
"work": 10, // Length of the work session in seconds
"shortBreak": 5, // Length of the short break in seconds
"longBreak": 10, // Length of the long break in seconds
"sessions": 2 // Number of total sessions
}
}
```
### Server Messages ### Server Messages
The server sends JSON-encoded messages to all connected clients to update them on the current state of the Pomodoro session. The server sends JSON-encoded messages to all connected clients to update them on the current state of the Pomodoro session.