35 lines
938 B
Markdown
35 lines
938 B
Markdown
# Bottle Signal-Light UI
|
|
|
|
A Bottle-based browser interface for the supplied FastAPI signal-light service.
|
|
|
|
## Features
|
|
|
|
- Mutually exclusive green, yellow, and red controls
|
|
- Independent alert buzzer on/off control
|
|
- Demo mode on/off control
|
|
- All-off command
|
|
- Automatic status polling every 1.5 seconds
|
|
- Server-side proxy, so the browser does not need CORS access to FastAPI
|
|
|
|
## Run
|
|
|
|
```bash
|
|
cd signal_light_ui
|
|
python3 -m venv .venv
|
|
source .venv/bin/activate
|
|
pip install -r requirements.txt
|
|
|
|
export SIGNAL_LIGHT_API_URL=http://127.0.0.1:8000
|
|
python app.py
|
|
```
|
|
|
|
Open `http://<raspberry-pi-address>:8080`.
|
|
|
|
## Configuration
|
|
|
|
- `SIGNAL_LIGHT_API_URL` — FastAPI base URL, default `http://127.0.0.1:8000`
|
|
- `SIGNAL_LIGHT_TIMEOUT` — upstream timeout in seconds, default `3`
|
|
- `BOTTLE_HOST` — Bottle listen address, default `0.0.0.0`
|
|
- `BOTTLE_PORT` — Bottle port, default `8080`
|
|
- `BOTTLE_DEBUG` — set to `true` for debug/reloader
|