From 854ed61add61fb958eb3da802c64cceb415f19f3 Mon Sep 17 00:00:00 2001 From: Striker72rus Date: Wed, 25 Mar 2026 15:45:45 +0300 Subject: [PATCH] - --- run.sh | 13 ++++++++++++- storage/popup_state.json | 4 ++-- wall_panel/config.yaml | 4 +++- wall_panel/run.sh | 15 +++++++++++++-- 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/run.sh b/run.sh index 71c7b28..b4f6858 100755 --- a/run.sh +++ b/run.sh @@ -17,17 +17,28 @@ export WALL_PANEL_CONFIG_PATH="$CONFIG_PATH" export WALL_PANEL_STORAGE_DIR="$STORAGE_DIR" export WALL_PANEL_RUNTIME_MODE="$RUNTIME_MODE" +log() { + echo "[wall_panel] $*" +} + +log "starting standalone runtime on port ${PORT} (mode=${RUNTIME_MODE})" +log "config path: ${CONFIG_PATH}" +log "storage dir: ${STORAGE_DIR}" + if [ "$RUNTIME_MODE" = "addon" ]; then ( i=0 while [ "$i" -lt 120 ]; do + log "registering ingress attempt $((i + 1))/120" if php -r 'require "/app/lib/bootstrap.php"; $config = app_load_config(); exit(app_register_ingress_url($config) ? 0 : 1);' >/dev/null 2>&1; then + log "ingress registered" exit 0 fi i=$((i + 1)) sleep 2 done - ) >/dev/null 2>&1 || true & + log "ingress registration failed after retries" + ) || true & fi exec php -S "0.0.0.0:${PORT}" -t "$DOCROOT" diff --git a/storage/popup_state.json b/storage/popup_state.json index 64c51a5..47e8779 100755 --- a/storage/popup_state.json +++ b/storage/popup_state.json @@ -1,6 +1,6 @@ { "active": false, - "sensor_entity_id": "binary_sensor.doorbell_all_occupancy", - "opened_at": 1774441493, + "sensor_entity_id": "binary_sensor.barn_all_occupancy", + "opened_at": 1774442675, "expires_at": null } diff --git a/wall_panel/config.yaml b/wall_panel/config.yaml index c00a38f..4b84b97 100755 --- a/wall_panel/config.yaml +++ b/wall_panel/config.yaml @@ -1,6 +1,6 @@ name: Wall Panel description: Wall Panel PHP interface as a Home Assistant add-on -version: "1.0.12" +version: "1.0.13" slug: wall_panel url: https://git.striker72rus.ru/PHP/wallpanell.git init: false @@ -15,6 +15,8 @@ ingress: true ingress_port: 8099 panel_title: Wall Panel panel_icon: mdi:view-dashboard +hassio_api: true +hassio_role: default ports: 8099/tcp: 8099 ports_description: diff --git a/wall_panel/run.sh b/wall_panel/run.sh index d2752fc..f3dd7b1 100755 --- a/wall_panel/run.sh +++ b/wall_panel/run.sh @@ -16,15 +16,26 @@ export WALL_PANEL_CONFIG_PATH="$CONFIG_PATH" export WALL_PANEL_STORAGE_DIR="$STORAGE_DIR" export WALL_PANEL_RUNTIME_MODE="addon" -( +log() { + echo "[wall_panel] $*" +} + +log "starting add-on on port ${PORT}" +log "config path: ${CONFIG_PATH}" +log "storage dir: ${STORAGE_DIR}" + +( i=0 while [ "$i" -lt 120 ]; do + log "registering ingress attempt $((i + 1))/120" if php -r 'require "/app/lib/bootstrap.php"; $config = app_load_config(); exit(app_register_ingress_url($config) ? 0 : 1);' >/dev/null 2>&1; then + log "ingress registered" exit 0 fi i=$((i + 1)) sleep 2 done -) >/dev/null 2>&1 || true & + log "ingress registration failed after retries" +) || true & exec php -S "0.0.0.0:${PORT}" -t "$DOCROOT"