Update use device on/off

This commit is contained in:
Hans Karlinius
2025-06-06 22:41:38 +02:00
parent 3eb0d5cc20
commit 3c572c5736
@@ -25,12 +25,12 @@ if bashio::config.has_value 'usbdevices'; then
#server_serial=$(/usr/bin/vh_server_serial_number ${deviceid%.*}) #server_serial=$(/usr/bin/vh_server_serial_number ${deviceid%.*})
#device2=$(/usr/bin/vh_usb_product_vendor $deviceid) #device2=$(/usr/bin/vh_usb_product_vendor $deviceid)
#deviceid2="${server_serial}.${device2}" #deviceid2="${server_serial}.${device2}"
bashio::log.info "GURKA-${inuse_devices[@]}" #bashio::log.info "GURKA-${inuse_devices[@]}"
if [[ ${inuse_devices[@]} =~ .*${deviceid}.* ]]; then if [[ ${inuse_devices[@]} =~ .*${deviceid}.* ]]; then
if $use; then if ! $use; then
bashio::log.info "AUTO USE DEVICE,${deviceid} - already in use" # bashio::log.info "AUTO USE DEVICE,${deviceid} - already in use"
else # else
bashio::log.info "STOP USING,${deviceid}" bashio::log.info "STOP USING,${deviceid}"
/usr/bin/vhclient -t "STOP USING,${deviceid}" /usr/bin/vhclient -t "STOP USING,${deviceid}"
fi fi
@@ -38,8 +38,8 @@ if bashio::config.has_value 'usbdevices'; then
if $use; then if $use; then
bashio::log.info "AUTO USE DEVICE,${deviceid}" bashio::log.info "AUTO USE DEVICE,${deviceid}"
/usr/bin/vhclient -t "AUTO USE DEVICE,${deviceid}" /usr/bin/vhclient -t "AUTO USE DEVICE,${deviceid}"
else # else
bashio::log.info "STOP USING,${deviceid} - not in use" # bashio::log.info "STOP USING,${deviceid} - not in use"
fi fi
fi fi