-
This commit is contained in:
parent
e2d8ba78b1
commit
841e191ee5
@ -99,16 +99,17 @@ function app_load_config(): array
|
||||
}
|
||||
}
|
||||
|
||||
if (!$pathExists) {
|
||||
$optionsPath = function_exists('app_addon_options_path')
|
||||
? app_addon_options_path()
|
||||
: '/data/options.json';
|
||||
if (is_file($optionsPath)) {
|
||||
$options = app_load_json_file($optionsPath, []);
|
||||
if (is_array($options) && $options !== []) {
|
||||
$config = array_replace_recursive($config, $options);
|
||||
}
|
||||
$optionsPath = function_exists('app_addon_options_path')
|
||||
? app_addon_options_path()
|
||||
: '/data/options.json';
|
||||
if (app_runtime_mode() === 'addon' && is_file($optionsPath)) {
|
||||
$options = app_load_json_file($optionsPath, []);
|
||||
if (is_array($options) && $options !== []) {
|
||||
$config = array_replace_recursive($config, $options);
|
||||
}
|
||||
}
|
||||
|
||||
if (!$pathExists || app_runtime_mode() === 'addon') {
|
||||
$json = json_encode($config, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
|
||||
if ($json === false) {
|
||||
throw new RuntimeException('Failed to encode default config');
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"active": false,
|
||||
"active": true,
|
||||
"sensor_entity_id": "binary_sensor.barn_all_occupancy",
|
||||
"opened_at": 1774436133,
|
||||
"expires_at": null
|
||||
"opened_at": 1774436558,
|
||||
"expires_at": 1774436594
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
name: Wall Panel
|
||||
description: Wall Panel PHP interface as a Home Assistant add-on
|
||||
version: "1.0.5"
|
||||
version: "1.0.6"
|
||||
slug: wall_panel
|
||||
url: https://git.striker72rus.ru/PHP/wallpanell.git
|
||||
init: false
|
||||
@ -22,7 +22,7 @@ ports_description:
|
||||
map:
|
||||
- type: homeassistant_config
|
||||
read_only: false
|
||||
path: /homeassistant/wall_panel
|
||||
path: /config/wall_panel
|
||||
homeassistant_api: true
|
||||
options:
|
||||
app:
|
||||
|
||||
@ -99,17 +99,17 @@ function app_load_config(): array
|
||||
}
|
||||
}
|
||||
|
||||
if (!$pathExists) {
|
||||
$optionsPath = function_exists('app_addon_options_path')
|
||||
? app_addon_options_path()
|
||||
: '/data/options.json';
|
||||
if (is_file($optionsPath)) {
|
||||
$options = app_load_json_file($optionsPath, []);
|
||||
if (is_array($options) && $options !== []) {
|
||||
$config = array_replace_recursive($config, $options);
|
||||
}
|
||||
$optionsPath = function_exists('app_addon_options_path')
|
||||
? app_addon_options_path()
|
||||
: '/data/options.json';
|
||||
if (app_runtime_mode() === 'addon' && is_file($optionsPath)) {
|
||||
$options = app_load_json_file($optionsPath, []);
|
||||
if (is_array($options) && $options !== []) {
|
||||
$config = array_replace_recursive($config, $options);
|
||||
}
|
||||
}
|
||||
|
||||
if (!$pathExists || app_runtime_mode() === 'addon') {
|
||||
$json = json_encode($config, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
|
||||
if ($json === false) {
|
||||
throw new RuntimeException('Failed to encode default config');
|
||||
|
||||
@ -3,7 +3,7 @@ set -eu
|
||||
|
||||
DOCROOT="${WALL_PANEL_DOCROOT:-/app}"
|
||||
PORT="${WALL_PANEL_PORT:-8099}"
|
||||
CONFIG_PATH="${WALL_PANEL_CONFIG_PATH:-/homeassistant/wall_panel/config.json}"
|
||||
CONFIG_PATH="${WALL_PANEL_CONFIG_PATH:-/config/wall_panel/config.json}"
|
||||
STORAGE_DIR="${WALL_PANEL_STORAGE_DIR:-/data/wall_panel}"
|
||||
|
||||
mkdir -p "$(dirname "$CONFIG_PATH")" "$STORAGE_DIR"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user