Skip to content

Commit

Permalink
Debug additions
Browse files Browse the repository at this point in the history
Add an option to list USB devices, and adapt the driver logs to
the system ones

Signed-off-by: Arnaud Quette <arnaudquette@eaton.com>
  • Loading branch information
arnaudquette-eaton committed Jun 18, 2024
1 parent 35bec4a commit fec0644
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions smartnut/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ options:
schema:
log_level: list(trace|debug|info|notice|warning|error|fatal)?
autoconf_usb_devices: bool?
list_usb_devices: bool?
autoconf_remote_nut_devices: bool?
manually_edit_devices: bool?
devices:
Expand Down
11 changes: 11 additions & 0 deletions smartnut/rootfs/etc/cont-init.d/smartnut.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ find /etc/nut -not -perm 0660 -type d -exec chmod 0660 {} \;
rm -f "${UPS_CONF}"
touch "${UPS_CONF}"

# Adapt driver log level to the system one
if bashio::debug; then
echo "debug_min 5" >> "${UPS_CONF}"
fi

# USB Debugging
if bashio::config.true 'list_usb_devices' ;then
bashio::log.info "Connected USB devices:"
lsusb
fi

# Check for USB devices first
if bashio::config.true 'autoconf_usb_devices' ;then

Expand Down

0 comments on commit fec0644

Please sign in to comment.