diff --git a/cookcli/rootfs/etc/cont-init.d/80-discovery.sh b/cookcli/rootfs/etc/cont-init.d/80-discovery.sh index 5167a0b..32f200a 100644 --- a/cookcli/rootfs/etc/cont-init.d/80-discovery.sh +++ b/cookcli/rootfs/etc/cont-init.d/80-discovery.sh @@ -2,7 +2,14 @@ bashio::log.info "=== Annonce de la découverte CookCLI ===" -bashio::discovery.set "cookcli" \ - '{"host": "'"$(bashio::addon.ip_address)"'", "port": 9081, "ssl": false}' +config=$(\ + bashio::var.json \ + host "http://$(bashio::addon.ip_address)" \ + port "^9081" \ +) -bashio::log.info "✅ Découverte annoncée sur le port 9081" \ No newline at end of file +if bashio::discovery "cookcli" "${config}" > /dev/null; then + bashio::log.info "Successfully sent discovery information to Home Assistant." +else + bashio::log.error "Discovery message to Home Assistant failed!" +fi