This commit is contained in:
Hans Karlinius
2024-11-30 01:44:31 +01:00
parent 36ee9367c6
commit 20c7924a1e
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
name: VirtualHere Client
version: "0.1.242"
version: "0.1.243"
slug: vhclient
description: VirtualHere Client
arch:
@@ -22,13 +22,14 @@ options=$(bashio::addon.options)
#mapfile -t devices < <(/usr/bin/vhclient -t LIST)
mapfile -t devices < <(/usr/bin/vh_list_devices)
for device in "${devices[@]}"; do
if [[ ! " ${options[*]} " =~ [[:space:]]${device}[[:space:]] ]]; then
if [[ ! " ${options.usbdevices[*]} " =~ [[:space:]]${device}[[:space:]] ]]; then
bashio::log.info "Adding to config: ${device}"
new_options=$(echo $options | jq -n --arg device "$device" '.usbdevices |= . + [{ device: ($device), use: false }]')
bashio::log.info "New options: ${new_options}"
payload=$(bashio::var.json options "^${new_options}")
bashio::log.info "Payload: ${payload}"
bashio::api.supervisor POST "/addons/self/options" "${payload}"
fi