feat: add startWecker and stopWecker mutations to start/stop alarm via API

- Add startWecker mutation: starts wecker.py via subprocess if not already ringing
- Add stopWecker mutation: kills the running wecker process via SIGTERM if ringing
- Both mutations handle the 'already ringing' / 'not ringing' edge cases gracefully
- Update README with API documentation for the new mutations
- Add comprehensive tests (unit + GraphQL endpoint)
This commit is contained in:
Markus Graf
2026-05-19 15:22:48 +02:00
parent 558c4ff5b6
commit df7bec1054
3 changed files with 149 additions and 0 deletions
+15
View File
@@ -99,6 +99,21 @@ mutation {
}
```
**Start the alarm immediately:**
```graphql
mutation {
startWecker
}
```
Returns `true` if the alarm started, `false` if it was already ringing (ignored).
**Stop the alarm immediately:**
```graphql
mutation {
stopWecker
}
```
Returns `true` if the alarm was stopped, `false` if it wasn't ringing.
### Example response for `isRinging`:
```json