Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sleitnick/alarmclock
Alarm clock for ESP8266
https://github.com/sleitnick/alarmclock
Last synced: 13 days ago
JSON representation
Alarm clock for ESP8266
- Host: GitHub
- URL: https://github.com/sleitnick/alarmclock
- Owner: Sleitnick
- Created: 2017-12-06T20:37:07.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-19T21:59:57.000Z (about 7 years ago)
- Last Synced: 2024-10-24T22:18:10.750Z (2 months ago)
- Language: Arduino
- Size: 42 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Alarm Clock
This is the code to an alarm clock that I built with the ESP8266 microcontroller.--------------
## Network
Does not include the necessary `Network.h` header file. That file should look like the following:
```c
#define NETWORK_SSID "ssid"
#define NETWORK_PSK "psk"
```--------------
## Endpoints
### `GET /`
Returns a simple 'success' message for testing purposes. Expected response:
```json
{
"success": true
}
```### `GET /brightness`
Gets the current display brightness. Response example:
```json
{
"brightness": 0
}
```### `POST /brightness`
Sets the current display brightness. Request example:
```json
{
"amount": 0
}
```
Amount can be between 0 and 15.### `GET /alarms`
Gets a list of all current alarms. Response example:
```json
{
"alarms": [
{
"index": 0,
"hour": 0,
"minute": 0,
"enabled": false
}
]
}
```### `GET /alarmcount`
Gets the number of available alarms. Response example:
```json
{
"count": 3
}
```### `GET /alarm`
Gets the current properties of an alarm.
Parameters:| Parameter | Value |
| --------- | ----- |
| alarm | 0 |Example request:
`/alarm?alarm=1`Example response:
```json
{
"alarm": 1,
"hour": 0,
"minute": 0,
"enabled": false
}
```### `POST /alarm`
Sets the current properties of an alarm.
URL-Encoded parameters:| Parameter | Value |
| --------- | ----- |
| alarm | 0 |
| hour | 0 |
| minute | 0 |
| enabled | false |