mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-01-10 16:44:00 +01:00
add extended logging feats
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# https://developers.home-assistant.io/docs/add-ons/configuration#add-on-config
|
||||
name: NSPanel Lovelace UI Addon
|
||||
version: "4.7.41"
|
||||
version: "4.7.43"
|
||||
slug: nspanel-lovelace-ui
|
||||
description: NSPanel Lovelace UI Addon
|
||||
services:
|
||||
@@ -17,7 +17,16 @@ init: false
|
||||
map:
|
||||
- addon_config:rw
|
||||
options:
|
||||
message: "Hello world..."
|
||||
loglevel:
|
||||
- DEBUG
|
||||
- INFO
|
||||
- WARNING
|
||||
- ERROR
|
||||
- CRITICAL
|
||||
logtofile:
|
||||
- true
|
||||
- false
|
||||
schema:
|
||||
message: "str?"
|
||||
loglevel: list(DEBUG|INFO|WARNING|ERROR|CRITICAL)
|
||||
logtofile: bool
|
||||
image: "ghcr.io/jobr99/{arch}-nspanel-lovelace-ui"
|
||||
|
||||
@@ -7,7 +7,7 @@ declare exit_code
|
||||
readonly exit_code_container=$(</run/s6-linux-init-container-results/exitcode)
|
||||
readonly exit_code_service="${1}"
|
||||
readonly exit_code_signal="${2}"
|
||||
readonly service="AppDaemon"
|
||||
readonly service="NsPanel Lovelace UI MQTT Manager"
|
||||
|
||||
bashio::log.info \
|
||||
"Service ${service} exited with code ${exit_code_service}" \
|
||||
|
||||
@@ -4,16 +4,5 @@
|
||||
# s6-overlay docs: https://github.com/just-containers/s6-overlay
|
||||
# ==============================================================================
|
||||
|
||||
# Add your code here
|
||||
|
||||
# Declare variables
|
||||
declare message
|
||||
|
||||
## Get the 'message' key from the user config options.
|
||||
message=$(bashio::config 'message')
|
||||
|
||||
## Print the message the user supplied, defaults to "Hello World..."
|
||||
bashio::log.info "${message:="Hello World..."}"
|
||||
|
||||
## Run your program
|
||||
exec /usr/bin/mqtt-manager/run.sh
|
||||
|
||||
@@ -14,4 +14,16 @@ if test -f "$CONFIG_FILE"; then
|
||||
else
|
||||
cp /usr/bin/mqtt-manager/panels.yaml.example $CONFIG_FILE
|
||||
fi
|
||||
python /usr/bin/mqtt-manager/main.py
|
||||
|
||||
declare LOGLEVEL
|
||||
declare logtofile
|
||||
LOGLEVEL=$(bashio::config 'loglevel')
|
||||
logtofile=$(bashio::config 'logtofile')
|
||||
|
||||
export LOGLEVEL
|
||||
|
||||
if [[ "$logtofile" == "true" ]]; then
|
||||
python /usr/bin/mqtt-manager/main.py 2>&1 | tee /config/out.log
|
||||
else
|
||||
python /usr/bin/mqtt-manager/main.py
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user