This is a small python server that uses [Bottle](https://bottlepy.org) to provide an encrypted REST interface to the pixo firmware (and future compatibles).
## API->pixo Definition
TBD
## Web->API Definition
TBD
## Telegram Bot->API Definition
Initial implementation will use [Python Telegram Bot](https://github.com/python-telegram-bot/python-telegram-bot) to create a Telegram interface that accepts
- Commands
- Images
- Animations
- Videos (This one is low priority/might not happen)
### Commands
For all commands that accept, but aren't supplied a specific input, the bot will automatically provide context-aware options (such as names of enrolled devices) or inputs (custom keyboard/number keyboard/normal keyboard)
-`/send [name/id] *ATTACHMENT*` - Sends the attached media (if supported) to the selected device.
- If `/auto` is configured for any device, simply forwarding media to the bot will `/send` it to the device(s)
-`/newdevice [name/id]` - Alias of `/device new [name/id]`, if no name provided, starts "New Device Wizard", a series of `/device` sub-commands to get started
-`/device [new/edit/del] [name/id]` - New enrolls a new device, Del will purge the device from the database, Edit engages **Device Configuration Mode** with the following available commands.
-`/exit` - Returns to normal mode
1. If `/protect` is not on, the user will be asked if they want to enable it
-`/connect` - Connects to the device with various options
1.`/device` (default) - The device will connect to the server from time to time (configurable in device settings). Generates a shared secret to be inputted in device settings
2.`/discover` - If the device is on the same network as the server, we can attempt autodiscovery and the server will establish a connection
-`/sensor [add/del] [name] [endpoint]` - If a sensor is not automatically detected, or you wish to remove a sensor, this will communicate to the device and read the value.
1. If the device does not have the endpoint, the sensor will not be added
-`/read [sensor]` - If the device has the named sensor, read the value and return it