mirror of
https://github.com/aljazceru/addons.git
synced 2025-12-17 13:14:21 +01:00
Expose log level as a configuration option for zwave_js (#1950)
This commit is contained in:
@@ -83,6 +83,20 @@ don't have a backup of this key, you won't be able to reconnect to any securely
|
|||||||
included devices. This may mean you have to do a factory reset on those devices
|
included devices. This may mean you have to do a factory reset on those devices
|
||||||
and your controller, before rebuilding your Z-Wave network.
|
and your controller, before rebuilding your Z-Wave network.
|
||||||
|
|
||||||
|
### Option `log_level` (optional)
|
||||||
|
|
||||||
|
This option sets the log level of Z-Wave JS. Valid options are:
|
||||||
|
- silly
|
||||||
|
- debug
|
||||||
|
- verbose
|
||||||
|
- http
|
||||||
|
- info
|
||||||
|
- warn
|
||||||
|
- error
|
||||||
|
|
||||||
|
If no `log_level` is specified, the log level will be set to the level set in
|
||||||
|
the Supervisor.
|
||||||
|
|
||||||
### Option `emulate_hardware` (optional)
|
### Option `emulate_hardware` (optional)
|
||||||
|
|
||||||
If you don't have a USB stick, you can use a fake stick for testing purposes.
|
If you don't have a USB stick, you can use a fake stick for testing purposes.
|
||||||
|
|||||||
@@ -18,11 +18,13 @@
|
|||||||
"discovery": ["zwave_js"],
|
"discovery": ["zwave_js"],
|
||||||
"options": {
|
"options": {
|
||||||
"device": null,
|
"device": null,
|
||||||
"network_key": ""
|
"network_key": "",
|
||||||
|
"log_level": "info"
|
||||||
},
|
},
|
||||||
"schema": {
|
"schema": {
|
||||||
"device": "device(subsystem=tty)",
|
"device": "device(subsystem=tty)",
|
||||||
"network_key": "match(|[0-9a-fA-F]{32,32})",
|
"network_key": "match(|[0-9a-fA-F]{32,32})",
|
||||||
|
"log_level": "list(silly|debug|verbose|http|info|warn|error)?",
|
||||||
"emulate_hardware": "bool?"
|
"emulate_hardware": "bool?"
|
||||||
},
|
},
|
||||||
"image": "homeassistant/{arch}-addon-zwave_js"
|
"image": "homeassistant/{arch}-addon-zwave_js"
|
||||||
|
|||||||
@@ -30,11 +30,19 @@ else
|
|||||||
network_key=$(bashio::config 'network_key')
|
network_key=$(bashio::config 'network_key')
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ! bashio::config.has_value 'log_level'; then
|
||||||
|
log_level=$(bashio::info.logging)
|
||||||
|
bashio::log.info "No log level specified, falling back to Supervisor"
|
||||||
|
bashio::log.info "log level (${log_level})..."
|
||||||
|
else
|
||||||
|
log_level=$(bashio::config 'log_level')
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Generate config
|
# Generate config
|
||||||
bashio::var.json \
|
bashio::var.json \
|
||||||
network_key "${network_key}" \
|
network_key "${network_key}" \
|
||||||
logging "$(bashio::info.logging)" \
|
log_level "${log_level}" \
|
||||||
| tempio \
|
| tempio \
|
||||||
-template /usr/share/tempio/zwave_config.conf \
|
-template /usr/share/tempio/zwave_config.conf \
|
||||||
-out /etc/zwave_config.json
|
-out /etc/zwave_config.json
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"logConfig": {
|
"logConfig": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"level": {{ if eq .logging "debug" }}5{{ else }}2{{ end }},
|
"level": "{{ .log_level }}",
|
||||||
"forceConsole": true
|
"forceConsole": true
|
||||||
},
|
},
|
||||||
"storage": {
|
"storage": {
|
||||||
|
|||||||
Reference in New Issue
Block a user