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
🤖
This commit is contained in:
parent
9149b1a78e
commit
2ac1aecba1
6 changed files with 46 additions and 22 deletions
17
README.md
17
README.md
|
@ -32,6 +32,23 @@ Clients communicate with the server by sending JSON-encoded commands. Each comma
|
|||
| `resume` | Resumes a paused session | `{"command": "resume"}` |
|
||||
| `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
|
||||
|
||||
The server sends JSON-encoded messages to all connected clients to update them on the current state of the Pomodoro session.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue