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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user