break: add updateSettings
command to modify Pomodoro settings
- add `updateSettings` command to modify Pomodoro configuration
- remove ability to set Pomodoro configuration in `start` command
- update demo client
- update README
🤖
This commit is contained in:
parent
a0dba673a2
commit
cb6616f400
5 changed files with 75 additions and 59 deletions
37
README.md
37
README.md
|
@ -28,30 +28,25 @@ If the client sends a command with an incorrect password it will not be allowed
|
|||
|
||||
Here are the available commands:
|
||||
|
||||
| Command | Action | Example Sent by Client |
|
||||
|----------|-------------------------------------|-----------------------------------|
|
||||
| `start` | Starts a new Pomodoro session | `{"command": "start", "password": ""}` |
|
||||
| `pause` | Pauses the current session | `{"command": "pause", "password": ""}` |
|
||||
| `resume` | Resumes a paused session | `{"command": "resume", "password": ""}` |
|
||||
| `reset` | Stops and resets the current session| `{"command": "reset", "password": ""}` |
|
||||
| Command | Action | Example Sent by Client |
|
||||
| ---------- | ------------------------------------- | ----------------------------------- |
|
||||
| `start` | Starts a new Pomodoro session | `{"command": "start", "password": ""}` |
|
||||
| `pause` | Pauses the current session | `{"command": "pause", "password": ""}` |
|
||||
| `resume` | Resumes a paused session | `{"command": "resume", "password": ""}` |
|
||||
| `reset` | Stops and resets the current session | `{"command": "reset", "password": ""}` |
|
||||
| `updateSettings` | Update Pomodoro settings | `{"command": "updateSettings", "password": "", "settings": {"work": 600, "shortBreak": 60, "longBreak": 300, "sessions": 2}}` |
|
||||
|
||||
#### Optional Start Parameters
|
||||
#### Update Settings Command (`updateSettings`)
|
||||
|
||||
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.
|
||||
The `updateSettings` command allows clients to modify the Pomodoro timer configuration, including the length of work sessions, short breaks, long breaks, and the total number of sessions in a cycle. This command must include a valid password to be accepted by the server. The updateSettings command can be used when the timer is stopped.
|
||||
|
||||
Example:
|
||||
```json
|
||||
{
|
||||
command: "start",
|
||||
password: "foobar",
|
||||
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
|
||||
}
|
||||
}
|
||||
```
|
||||
- Fields in the `settings` Object:
|
||||
- `work`: Length of the work session (in seconds).
|
||||
- `shortBreak`: Length of the short break (in seconds).
|
||||
- `longBreak`: Length of the long break (in seconds).
|
||||
- `sessions`: Total number of work/break sessions in the Pomodoro cycle.
|
||||
|
||||
All fields are mandatory and may not be ommitted.
|
||||
|
||||
### Server Messages
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue