docs
This commit is contained in:
@@ -12,11 +12,46 @@ The abstraction layer is an asyncio-based worker that manages device communicati
|
||||
|
||||
## Running
|
||||
|
||||
### Local Development
|
||||
|
||||
```bash
|
||||
# Start the abstraction worker
|
||||
poetry run python -m apps.abstraction.main
|
||||
```
|
||||
|
||||
### Docker Container
|
||||
|
||||
#### Build Image
|
||||
|
||||
```bash
|
||||
docker build -t abstraction:dev -f apps/abstraction/Dockerfile .
|
||||
```
|
||||
|
||||
#### Run Container
|
||||
|
||||
```bash
|
||||
docker run --rm \
|
||||
-v $(pwd)/config:/app/config:ro \
|
||||
-e MQTT_BROKER=172.16.2.16 \
|
||||
-e MQTT_PORT=1883 \
|
||||
-e REDIS_HOST=172.23.1.116 \
|
||||
-e REDIS_PORT=6379 \
|
||||
-e REDIS_DB=8 \
|
||||
abstraction:dev
|
||||
```
|
||||
|
||||
#### Environment Variables
|
||||
|
||||
| Variable | Default | Description |
|
||||
|----------|---------|-------------|
|
||||
| `MQTT_BROKER` | `172.16.2.16` | MQTT broker hostname/IP |
|
||||
| `MQTT_PORT` | `1883` | MQTT broker port |
|
||||
| `REDIS_HOST` | `localhost` | Redis server hostname/IP |
|
||||
| `REDIS_PORT` | `6379` | Redis server port |
|
||||
| `REDIS_DB` | `0` | Redis database number |
|
||||
|
||||
### What the Worker Does
|
||||
|
||||
The worker will:
|
||||
1. Load configuration from `config/devices.yaml`
|
||||
2. Connect to MQTT broker (172.16.2.16:1883)
|
||||
|
||||
Reference in New Issue
Block a user