From 17a033c7d88efdce229946472724c17108217a32 Mon Sep 17 00:00:00 2001 From: Timmo Date: Sat, 12 Oct 2019 22:04:41 +0100 Subject: [PATCH] :sparkles: Add discovery init script --- home-panel/rootfs/etc/cont-init.d/discovery.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 home-panel/rootfs/etc/cont-init.d/discovery.sh diff --git a/home-panel/rootfs/etc/cont-init.d/discovery.sh b/home-panel/rootfs/etc/cont-init.d/discovery.sh new file mode 100644 index 0000000..44afcbf --- /dev/null +++ b/home-panel/rootfs/etc/cont-init.d/discovery.sh @@ -0,0 +1,18 @@ +#!/usr/bin/with-contenv bashio +# ============================================================================== +# Community Hass.io Add-ons: Home Panel +# Sends discovery information to Home Assistant. +# ============================================================================== +declare config + +config=$(\ + bashio::var.json \ + host "127.0.0.1" \ + port "^45158" \ +) + +if bashio::discovery "home_panel" "${config}" > /dev/null; then + bashio::log.info "Successfully send discovery information to Home Assistant." +else + bashio::log.error "Discovery message to Home Assistant failed!" +fi