Compare commits

...

2 Commits

Author SHA1 Message Date
Gangoke
31913d4a43 feat: add API endpoint for bridge restart functionality 2026-05-20 21:34:03 -10:00
534ea41816 docs: Update-Warnung im 0.9.13-CHANGELOG 2026-05-20 17:56:50 +02:00
4 changed files with 87 additions and 23 deletions

2
.gitignore vendored
View File

@@ -7,3 +7,5 @@ dist/
releases/*/kx-bridge
releases/*/extract_credentials
releases/*/extract_credentials.exe
config/config.ini
data/

View File

@@ -2,19 +2,47 @@
## [0.9.13] 2026-05-20
### Fixes
- **Self-Update war in 0.9.12 kaputt (wichtig):** Der In-App-Updater ersetzte
nur `kobrax_moonraker_bridge.py`, aber seit 0.9.12 importiert diese Datei das
ausgelagerte `_web_assets.py` (gebündeltes Frontend). Ein Update auf 0.9.12
crashte daher mit `ModuleNotFoundError: No module named '_web_assets'` und die
Bridge kam nicht wieder hoch. Der Updater lädt jetzt **alle** Bridge-Module
(Hauptdatei + `_web_assets.py` + Client + Loader) erst vollständig herunter
und ersetzt sie dann atomar — und verweigert das Self-Update im Binary-Modus
(stattdessen neue Binary/neues Docker-Image laden).
============================================================
STOPP — VOR DEM DRÜCKEN VON "UPDATE" LESEN
============================================================
> Falls du nach dem Update auf 0.9.12 hängengeblieben bist: einmalig das
> Docker-Image neu bauen/deployen oder die 0.9.13-Binary holen, danach
> funktioniert das Self-Update wieder.
Der "Update"-Button ist in 0.9.11 und 0.9.12 KAPUTT.
NICHT benutzen. Stattdessen einmalig manuell updaten —
ab 0.9.13 funktioniert er wieder.
>> WINDOWS-.EXE / LINUX-BINARY-Nutzer — GEFAHR:
Update ÜBERSCHREIBT deine kx-bridge.exe / kx-bridge mit
einer Textdatei. Das Programm STARTET DANN NICHT MEHR
und kann sich nicht selbst reparieren.
--> Manuell updaten: die 0.9.13
kx-bridge-windows.zip / kx-bridge-linux.zip von der
Releases-Seite laden und die alte Datei ersetzen.
Deine config/- und data/-Ordner bleiben erhalten.
>> DOCKER-Nutzer:
Update führt zur Crash-Loop des Containers
(ModuleNotFoundError: No module named '_web_assets').
--> Manuell updaten:
docker compose pull (oder docker compose up -d --build)
config- + data-Volumes bleiben erhalten.
Ab 0.9.13 ist der In-App-Updater repariert und wieder sicher.
============================================================
### Fixes
- **Self-Update war in 0.9.11 und 0.9.12 kaputt (kritisch):** Der In-App-Updater
ersetzte nur `kobrax_moonraker_bridge.py`. Zwei Probleme:
- **Binary/EXE-Modus:** Er überschrieb die laufende Programmdatei
(`sys.executable`) mit einer Python-Textdatei — übrig blieb ein nicht mehr
startbares Programm, das sich nicht selbst reparieren kann (manueller
Re-Download nötig).
- **Python/Docker-Modus:** Seit 0.9.12 importiert die Hauptdatei das
ausgelagerte `_web_assets.py` (gebündeltes Frontend), das der Updater nicht
mitlud → `ModuleNotFoundError: No module named '_web_assets'` → Crash-Loop.
Der Updater lädt jetzt **alle** Bridge-Module (Hauptdatei + `_web_assets.py` +
Client + Loader) erst vollständig herunter, ersetzt sie dann atomar und
**verweigert das Self-Update im Binary-Modus** (mit Verweis auf den manuellen
Download).
## [0.9.12] 2026-05-20

View File

@@ -2,18 +2,45 @@
## [0.9.13] 2026-05-20
### Fixes
- **Self-update was broken for 0.9.12 (important):** the in-app updater only
replaced `kobrax_moonraker_bridge.py`, but since 0.9.12 that file imports the
extracted `_web_assets.py` (bundled frontend). Updating to 0.9.12 therefore
crashed with `ModuleNotFoundError: No module named '_web_assets'` and the
bridge wouldn't come back up. The updater now downloads **all** bridge modules
(main file + `_web_assets.py` + client + loaders), fully, then swaps them
atomically — and refuses to self-update in binary mode (use the new
binary/Docker image instead).
============================================================
STOP — READ THIS BEFORE PRESSING "UPDATE"
============================================================
> If you got stuck on 0.9.12 after pressing update: rebuild/redeploy the Docker
> image or grab the 0.9.13 binary once, then self-update works again.
The in-app "Update" button is BROKEN in 0.9.11 and 0.9.12.
Do NOT use it. Update manually instead (one time), then it
works again from 0.9.13 onward.
>> WINDOWS .EXE / LINUX BINARY users — DANGER:
Pressing Update OVERWRITES your kx-bridge.exe / kx-bridge
with a text file. The program will NOT start anymore.
It cannot repair itself.
--> Update manually: download the 0.9.13
kx-bridge-windows.zip / kx-bridge-linux.zip from the
Releases page and replace your old file.
Your config/ and data/ folders are kept.
>> DOCKER users:
Pressing Update makes the container crash-loop
(ModuleNotFoundError: No module named '_web_assets').
--> Update manually:
docker compose pull (or docker compose up -d --build)
Your config + data volumes are kept.
From 0.9.13 on, the in-app updater is fixed and safe again.
============================================================
### Fixes
- **Self-update was broken in 0.9.11 and 0.9.12 (critical):** the in-app updater
only replaced `kobrax_moonraker_bridge.py`. Two problems:
- **Binary/EXE mode:** it overwrote the running executable (`sys.executable`)
with a Python text file, leaving an unstartable program that can't recover
itself — manual re-download required.
- **Python/Docker mode:** since 0.9.12 the main file imports the extracted
`_web_assets.py` (bundled frontend), which the updater didn't fetch →
`ModuleNotFoundError: No module named '_web_assets'` → crash loop.
The updater now downloads **all** bridge modules (main file + `_web_assets.py`
+ client + loaders) fully, then swaps them atomically, and **refuses to
self-update in binary mode** (pointing you to the manual download instead).
## [0.9.12] 2026-05-20

View File

@@ -2033,6 +2033,12 @@ class KobraXBridge:
log.info("Manuell getrennt")
return web.json_response({"result": "disconnected"})
async def handle_api_restart(self, request):
log.info("Neustart über API angefordert")
response = web.json_response({"status": "restarting"})
asyncio.get_event_loop().call_later(0.3, self._restart_bridge)
return response
async def handle_api_speed(self, request):
try:
body = await request.json()
@@ -3213,6 +3219,7 @@ def build_app(bridge: KobraXBridge) -> web.Application:
r.add_post("/api/fan", bridge.handle_api_fan)
r.add_post("/api/connect", bridge.handle_api_connect)
r.add_post("/api/disconnect", bridge.handle_api_disconnect)
r.add_post("/api/restart", bridge.handle_api_restart)
r.add_post("/api/speed", bridge.handle_api_speed)
r.add_post("/api/ams/feed", bridge.handle_api_ams_feed)
r.add_post("/api/ams/set_slot", bridge.handle_api_ams_set_slot)