diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..f6be041 --- /dev/null +++ b/.env.example @@ -0,0 +1,2 @@ +SILLYHOME_HA_URL=http://homeassistant.local:8123 +SILLYHOME_HA_TOKEN=REPLACE_ME_WITH_LONG_LIVED_TOKEN diff --git a/README.md b/README.md index e983512..7165428 100644 --- a/README.md +++ b/README.md @@ -12,3 +12,41 @@ TheSillyHome zeigte die Idee: statt statischer Regeln das Zuhause aus Verhaltens - Automationen vorschlagen und direkt generieren - Lokal-first ohne Cloudpflicht - Erweiterbar, testbar, dokumentiert + +## APPENDIX + +### Quickstart +1. Python-Venv anlegen und Abhängigkeiten installieren: +```bash +python -m venv .venv +source .venv/bin/activate +pip install -e . +``` + +2. Konfiguration aus `.env.example` übernehmen und anpassen: +```bash +cp .env.example .env +``` + +3. API starten: +```bash +uvicorn app.main:app --reload +``` + +4. Erreichbar unter: +- `http://127.0.0.1:8000/health` - Health-Check +- `http://127.0.0.1:8000/docs/` - OpenAPI-Dokumentation +- `http://127.0.0.1:8000/v1/entities` - Home-Assistant-Entities + +### ENV-Konfiguration (`.env.example`) +- `SILLYHOME_HA_URL` – Basis-URL deiner Home-Assistant-Instanz (z. B. `http://homeassistant.local:8123`) +- `SILLYHOME_HA_TOKEN` – Long-Lived Access Token aus Home Assistant (nur lesen) + +Hinweis: Nutze ausschließlich Long-Lived Access Tokens mit Leserechten. Niemals Administrator-Tokens oder Passwörter eintragen. `.env` gehört nicht in Versionskontrollsysteme. + +### Tests +```bash +pytest -q +ruff check . +mypy app tests +``` \ No newline at end of file