Files
home-assistant-addons/vhclient/rootfs/etc/s6-overlay/s6-rc.d/test/run
T
Hans Karlinius 62f3b9deea test
2024-11-28 16:47:17 +01:00

21 lines
777 B
Plaintext
Executable File

#!/command/with-contenv bashio
set -x
#test=($(bashio::config 'test'))
#test+=('one', 'two')
#bashio::config::update 'test' "${test[@]}"
#bashio::addon.option 'test' $test[@]
#TEST
#bashio::addon.option 'usbdevices' { 'name': 'one', 'use': false}
#my_array=($(bashio::config 'my_array'))
#my_array+=('one') # Add a new item to the array
#my_array+=({ 'name': 'one', 'use': false}) # Add a new item to the array
#bashio::config::update 'my_array' "${my_array[@]}"
options=$(bashio::addon.options)
new_options=$(echo $options | jq .test[gurka=false])
payload=$(bashio::var.json options "^${new_options}")
bashio::api.supervisor POST "/addons/self/options" "${payload}"
curl -sH "Authorization: Bearer $SUPERVISOR_TOKEN" http://supervisor/addons/self/info | jq .data.options