Skip to content

Commit fec0644

Browse files
committedJun 18, 2024·
Debug additions
Add an option to list USB devices, and adapt the driver logs to the system ones Signed-off-by: Arnaud Quette <[email protected]>
1 parent 35bec4a commit fec0644

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed
 

‎smartnut/config.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ options:
2929
schema:
3030
log_level: list(trace|debug|info|notice|warning|error|fatal)?
3131
autoconf_usb_devices: bool?
32+
list_usb_devices: bool?
3233
autoconf_remote_nut_devices: bool?
3334
manually_edit_devices: bool?
3435
devices:

‎smartnut/rootfs/etc/cont-init.d/smartnut.sh

+11
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@ find /etc/nut -not -perm 0660 -type d -exec chmod 0660 {} \;
2222
rm -f "${UPS_CONF}"
2323
touch "${UPS_CONF}"
2424

25+
# Adapt driver log level to the system one
26+
if bashio::debug; then
27+
echo "debug_min 5" >> "${UPS_CONF}"
28+
fi
29+
30+
# USB Debugging
31+
if bashio::config.true 'list_usb_devices' ;then
32+
bashio::log.info "Connected USB devices:"
33+
lsusb
34+
fi
35+
2536
# Check for USB devices first
2637
if bashio::config.true 'autoconf_usb_devices' ;then
2738

0 commit comments

Comments
 (0)
Please sign in to comment.