Update use device on/off

This commit is contained in:
Hans Karlinius
2025-06-06 18:32:43 +02:00
parent 141e119ca3
commit 3392f4c8cd
3 changed files with 13 additions and 5 deletions

View File

@@ -1,3 +1,7 @@
## 0.3.0
- Update handling of setting device to used and not used.
## 0.2.1
- Added documentation.

View File

@@ -7,7 +7,7 @@ arch:
- aarch64
- amd64
- i386
url: "https://git.carlscrona.se/haka/home-assistant-addons"
url: "https://github.com/hans99/home-assistant-addons"
startup: services
host_network: true
hassio_api: true

View File

@@ -28,12 +28,16 @@ if bashio::config.has_value 'usbdevices'; then
bashio::log.info "GURKA-${deviceid2}"
if $use; then
bashio::log.info "AUTO USE DEVICE,${deviceid}"
/usr/bin/vhclient -t "AUTO USE DEVICE,${deviceid}"
#bashio::log.info "AUTO USE DEVICE,${deviceid}"
#/usr/bin/vhclient -t "AUTO USE DEVICE,${deviceid}"
bashio::log.info "AutoShare ${deviceid2} on"
/usr/bin/vh_editini AutoShare $deviceid2 1
else
if [[ "${inuse_devices[@]}" =~ "$device" ]]; then
bashio::log.info "STOP USING,${deviceid}"
/usr/bin/vhclient -t "STOP USING,${deviceid}"
#bashio::log.info "STOP USING,${deviceid}"
#/usr/bin/vhclient -t "STOP USING,${deviceid}"
bashio::log.info "AutoShare ${deviceid2} off"
/usr/bin/vh_editini AutoShare $deviceid2 0
fi
fi
done