Update use device on/off

This commit is contained in:
Hans Karlinius
2025-06-06 14:18:42 +02:00
parent de36df872c
commit 4da92371ac
3 changed files with 13 additions and 1 deletions

View File

@@ -8,7 +8,7 @@ fi
autouse=$(bashio::cache.get autouse)
if $autouse; then
bashio::log.info "AutoShare enabled, will not use devices from configuration"
bashio::log.info "AutoShare All enabled, will not use devices from configuration"
exit 0
fi
@@ -21,6 +21,12 @@ if bashio::config.has_value 'usbdevices'; then
use=$(echo $usbdevice | jq '. | if .use then true else false end')
device=$(echo $usbdevice | jq '.device | tostring')
deviceid=$(echo $device | sed 's/.*(\(.*\)).*/\1/g')
server_serial=$(/usr/bin/vh_server_serial_number ${deviceid%.*})
device2=$(/usr/bin/vh_usb_product_vendor $deviceid)
deviceid2=$(server_serial.$device2)
bashio::log.info "GURKA-${deviceid2}"
if $use; then
bashio::log.info "AUTO USE DEVICE,${deviceid}"
/usr/bin/vhclient -t "AUTO USE DEVICE,${deviceid}"